10#include <sys/socket.h>
11#include <netinet/in.h>
60int net_socket_connect(
net_socket_t* socket,
char* ip, uint16_t port);
69int net_socket_send(
net_socket_t* socket,
const void* data,
int len);
79int net_socket_sendto(
net_socket_t* socket,
const void* data,
int len,
const struct sockaddr_in* addr);
88int net_socket_receive(
net_socket_t* socket,
void* buffer,
int max_len);
98int net_socket_receive_from(
net_socket_t* socket,
void* buffer,
int max_len,
struct sockaddr_in* sender_addr);
107int net_socket_bind(
net_socket_t* socket,
const char* ip, uint16_t port);
119uint16_t net_socket_get_local_port(
const net_socket_t* s);
126int net_socket_listen(
net_socket_t* socket,
int backlog);
141ECSNET_API
void net_socket_init(
void);
149ECSNET_API
void net_socket_cleanup(
void);
Represents a network socket. This struct encapsulates the socket's file descriptor,...
Definition net_socket.h:33
struct sockaddr_in addr
Definition net_socket.h:34
int fd
Definition net_socket.h:36
socket_type_t type
Definition net_socket.h:35