You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
479 B
23 lines
479 B
#ifndef __SOCKET_H__
|
|
#define __SOCKET_H__
|
|
|
|
#include <arpa/inet.h> /* for in_port_t */
|
|
|
|
#include "logger.h"
|
|
#include "cclass.h"
|
|
|
|
|
|
CLASS(SOCK) {
|
|
LOGGER logger;
|
|
in_port_t port;
|
|
struct sockaddr_in addr;
|
|
int handle; /* socket handle for server */
|
|
};
|
|
|
|
void sock_connect(SOCK this, const char * addr);
|
|
void sock_listen(SOCK this, int backlog);
|
|
SOCK sock_accept(SOCK this, char remoteAddr[16]);
|
|
|
|
#endif /* __SOCKET_H__ */
|
|
|
|
// vim: set ts=4 sw=4:
|