#include "liblightify-private.h"
#include "socket.h"
#include "context.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
Go to the source code of this file.
◆ read_from_socket()
int read_from_socket |
( |
struct lightify_ctx * |
ctx, |
|
|
unsigned char * |
msg, |
|
|
size_t |
size |
|
) |
| |
Read from socket, handling async I/O and co
- Parameters
-
ctx | library context |
msg | where to store the result |
size | expected read, also buffer size of msg. |
- Returns
- actual read bytes, <0 on errors
Definition at line 121 of file socket.c.
◆ write_to_socket()
int write_to_socket |
( |
struct lightify_ctx * |
ctx, |
|
|
unsigned char * |
msg, |
|
|
size_t |
size |
|
) |
| |
Write msg to socket; handling async IO and co
- Parameters
-
ctx | library context |
msg | what to write |
size | how many bytes to be written |
- Returns
- negative: error, positive: number of bytes written.
Definition at line 45 of file socket.c.