Go to the documentation of this file.
26 #ifndef SOPC_RAW_SOCKETS_H_
27 #define SOPC_RAW_SOCKETS_H_
41 #include "p_sopc_sockets.h"
59 unsigned int firstProbeDelay,
60 unsigned int interval,
61 unsigned int counter);
bool SOPC_SocketSet_IsPresent(Socket sock, SOPC_SocketSet *sockSet)
Returns if a socket is present in the given socket set.
struct addrinfo SOPC_Socket_Address
Socket address information on a connected socket.
Definition: p_sopc_sockets.h:50
uint8_t SOPC_Socket_AddrInfo_IsIPV6(const SOPC_Socket_AddressInfo *addr)
Given a socket addressing information element, returns 0 if address is not IPV6 and not 0 value other...
void SOPC_SocketAddress_Delete(SOPC_Socket_Address **addr)
Deallocate a socket address obtained with SOPC_Socket_GetPeerAddress or SOPC_Socket_CopyAddress.
int32_t SOPC_Socket_WaitSocketEvents(SOPC_SocketSet *readSet, SOPC_SocketSet *writeSet, SOPC_SocketSet *exceptSet, uint32_t waitMs)
Wait for events (read, write and exception) on the sockets in the given sets for a given duration....
SOPC_Socket_Address * SOPC_Socket_GetPeerAddress(Socket sock)
Given a socket get the address information associated to the peer connected to the socket.
SOPC_ReturnStatus SOPC_Socket_Listen(Socket sock, SOPC_Socket_AddressInfo *addr)
Configure the socket to listen connections using the given addressing information Connection on a lis...
SOPC_ReturnStatus SOPC_SocketAddress_GetNameInfo(const SOPC_Socket_Address *addr, char **host, char **service)
Get address information as C strings from the given socket address.
SOPC_ReturnStatus SOPC_Socket_CreateNew(SOPC_Socket_AddressInfo *addr, bool setReuseAddr, bool setNonBlocking, Socket *sock)
Create a new socket using the addressing information provided.
void SOPC_Socket_AddrInfoDelete(SOPC_Socket_AddressInfo **addrs)
Deallocate a linked list of socket addressing information.
SOPC_ReturnStatus SOPC_Socket_Write(Socket sock, const uint8_t *data, uint32_t count, uint32_t *sentBytes)
Write data through the socket.
bool SOPC_Socket_Network_Initialize(void)
Initialize the network communication allowing to use sockets.
SOPC_ReturnStatus SOPC_Socket_CheckAckConnect(Socket sock)
Operation to check connection establishment result on a connecting socket After using SOPC_Socket_Con...
SOPC_ReturnStatus SOPC_Socket_Connect(Socket sock, SOPC_Socket_AddressInfo *addr)
Operation to establish a connection using the given socket and addressing information Connection esta...
void SOPC_Socket_Clear(Socket *sock)
Clear socket state to an invalid socket.
void SOPC_SocketSet_Add(Socket sock, SOPC_SocketSet *sockSet)
Add a socket to the given socket set.
void SOPC_SocketSet_Clear(SOPC_SocketSet *sockSet)
Clear a socket set.
SOPC_ReturnStatus SOPC_Socket_Network_Enable_Keepalive(Socket sock, unsigned int firstProbeDelay, unsigned int interval, unsigned int counter)
Activate the keep alive mechanism. According to RFC1122, this mechanism shall be used with care: deac...
SOPC_Socket_AddressInfo * SOPC_Socket_AddrInfo_IterNext(SOPC_Socket_AddressInfo *addr)
Given a socket addressing information element of a linked list, provides the next addressing informat...
SOPC_ReturnStatus SOPC_Socket_Network_Disable_Keepalive(Socket sock)
Deactivate the keep alive mechanism.
SOPC_ReturnStatus SOPC_Socket_ConnectToLocal(Socket from, Socket to)
Operation to establish a connection using the given socket to the given local socket....
bool SOPC_Socket_Network_Clear(void)
Clear the network communication when sockets not used anymore.
SOPC_ReturnStatus SOPC_Socket_AddrInfo_Get(const char *hostname, const char *port, SOPC_Socket_AddressInfo **addrs)
Provide a linked list of socket addressing information for establishing TCP connections over IPV4 and...
Set of sockets type.
Definition: p_sopc_sockets.h:56
SOPC_ReturnStatus SOPC_Socket_Read(Socket sock, uint8_t *data, uint32_t dataSize, uint32_t *readCount)
Read data through the socket.
SOPC_ReturnStatus SOPC_Socket_BytesToRead(Socket sock, uint32_t *bytesToRead)
Retrieve number of bytes available to read on the socket.
SOPC_ReturnStatus SOPC_Socket_Accept(Socket listeningSock, bool setNonBlocking, Socket *acceptedSock)
Operation to accept a connection on a listening socket Connection on a listening socket is detected w...
struct addrinfo SOPC_Socket_AddressInfo
Socket addressing information for listening or connecting operation type.
Definition: p_sopc_sockets.h:45
void SOPC_Socket_Close(Socket *sock)
Close the socket connection and/or clear the socket.
Definition: p_sopc_sockets.h:30
SOPC_Socket_Address * SOPC_Socket_CopyAddress(SOPC_Socket_AddressInfo *addr)
Copy the socket address from a socket address information.
SOPC_ReturnStatus
Definition: libs2opc_client.h:64