libiec61850  1.2.0
Typedefs | Functions
hal_socket.h File Reference
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Typedefs

typedef struct sServerSocket * ServerSocket
 
typedef struct sSocket * Socket
 
typedef struct sHandleSet * HandleSet
 

Functions

HandleSet Handleset_new (void)
 Create a new connection handle set (HandleSet) More...
 
void Handleset_addSocket (HandleSet self, const Socket sock)
 add a socket to an existing handle set More...
 
int Handleset_waitReady (HandleSet self, unsigned int timeoutMs)
 wait for a socket to become ready More...
 
void Handleset_destroy (HandleSet self)
 destroy the HandleSet instance More...
 
ServerSocket TcpServerSocket_create (const char *address, int port)
 Create a new TcpServerSocket instance. More...
 
void ServerSocket_listen (ServerSocket self)
 
Socket ServerSocket_accept (ServerSocket self)
 accept a new incoming connection (non-blocking) More...
 
void ServerSocket_setBacklog (ServerSocket self, int backlog)
 set the maximum number of pending connection in the queue More...
 
void ServerSocket_destroy (ServerSocket self)
 destroy a server socket instance More...
 
Socket TcpSocket_create (void)
 create a TCP client socket More...
 
void Socket_setConnectTimeout (Socket self, uint32_t timeoutInMs)
 set the timeout to establish a new connection More...
 
bool Socket_connect (Socket self, const char *address, int port)
 connect to a server More...
 
int Socket_read (Socket self, uint8_t *buf, int size)
 read from socket to local buffer (non-blocking) More...
 
int Socket_write (Socket self, uint8_t *buf, int size)
 send a message through the socket More...
 
char * Socket_getPeerAddress (Socket self)
 Get the address of the peer application (IP address and port number) More...
 
void Socket_destroy (Socket self)
 destroy a socket (close the socket if a connection is established) More...