socket.h 446 Bytes
#ifndef __SOCKET_H__
#define __SOCKET_H__

#include <arpa/inet.h>  /* for in_port_t */ 

#include "class.h"
#include "logger.h"

CLASS(Sock) {
	Logger             log;
	in_port_t          port;
	struct sockaddr_in addr;
	int                handle;
};

void socketConnect(Sock this, const char * addr);
void socketListen(Sock this, int backlog);
Sock socketAccept(Sock this, char (*remoteAddr)[]);

#endif // __SOCKET_H__

// vim: set ts=4 sw=4: