Simple tools for networking / objects in plain C Snapshot
Functions
sock.c File Reference
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "sock.h"
#include "ioutils.h"

Go to the source code of this file.

Functions

int SOCK_attach (SOCKCTX *ctx, int fd, int verbose, int flags)
int SOCK_init (SOCKCTX *ctx, int verbose, int flags)
 creates a socket and sets some options
int SOCK_send_buffer_sizes (SOCKCTX *ctx, int read_buffer_size, int write_buffer_size)
 set read and write buffer sizes; a value of -1 for buffer size is ignored.
int SOCK_connect (SOCKCTX *ctx, void *addr, int addr_size, int connect_timeout)
 connects a sockets with timeout (in seconds)
int SOCK_recv (SOCKCTX *ctx, void *msg, size_t length, int read_timeout)
 read some data from a socket with timeout (in seconds)
int SOCK_recv_all (SOCKCTX *ctx, void *msg, size_t length, int read_timeout)
 read whe whole buffer from a socket with timeout (in seconds)
int SOCK_send (SOCKCTX *ctx, void *bmsg, size_t length, int write_timeout)
 write whe whole buffer from a socket with timeout (in seconds)
int SOCK_close (SOCKCTX *ctx)
 close the
int SOCK_close_with_reset (SOCKCTX *ctx)
 ungraceful connection termination.