liblightify
socket.h File Reference
#include <stdlib.h>
Include dependency graph for socket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int write_to_socket (struct lightify_ctx *ctx, unsigned char *msg, size_t size)
 
int read_from_socket (struct lightify_ctx *ctx, unsigned char *msg, size_t size)
 

Detailed Description

Created on: 17.08.2015 Author: tobi

Definition in file socket.h.

Function Documentation

§ 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
ctxlibrary context
msgwhere to store the result
sizeexpected 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
ctxlibrary context
msgwhat to write
sizehow many bytes to be written
Returns
negative: error, positive: number of bytes written.

Definition at line 45 of file socket.c.