libIEC61850  0.8.0
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
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
 

Functions

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...
 
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...