![]() |
WiConnect Host Library- API Reference Guide | ||
TCP methods. More...
Functions | |
WiconnectResult | wiconnect::SocketInterface::tcpConnect (WiconnectSocket &socket, const char *host, uint16_t remortPort, Pin irqPin=PIN_NC) |
Connect to remote TCP server. More... | |
WiconnectResult | wiconnect::SocketInterface::tcpListen (uint16_t listeningPort, int maxClients=0, Pin irqPin=PIN_NC) |
Start internal TCP server and listen on specified port. More... | |
WiconnectResult | wiconnect::SocketInterface::tcpAccept (WiconnectSocket &socket, int timeoutMs=WICONNECT_WAIT_FOREVER) |
Wait for next client to connect to TCP server. More... | |
WiconnectResult | wiconnect::SocketInterface::tcpServerStop (void) |
Stop TCP server from listening on port. Close all connected clients. More... | |
TCP methods.
WiconnectResult wiconnect::SocketInterface::tcpAccept | ( | WiconnectSocket & | socket, |
int | timeoutMs = WICONNECT_WAIT_FOREVER |
||
) |
Wait for next client to connect to TCP server.
[in] | socket | Socket to connected client |
[in] | timeoutMs | Optional, specifiy maximum amount of time in ms to wait for a client |
WiconnectResult wiconnect::SocketInterface::tcpConnect | ( | WiconnectSocket & | socket, |
const char * | host, | ||
uint16_t | remortPort, | ||
Pin | irqPin = PIN_NC |
||
) |
Connect to remote TCP server.
[out] | socket | TCP WiconnectSocket object of opened connection. |
[in] | host | The host/IP address of the remote TCP server |
[in] | remortPort | The port of the remote server |
[in] | irqPin | Optional, Data available external interrupt pin. See registerSocketIrqHandler() for more info |
WiconnectResult wiconnect::SocketInterface::tcpListen | ( | uint16_t | listeningPort, |
int | maxClients = 0 , |
||
Pin | irqPin = PIN_NC |
||
) |
Start internal TCP server and listen on specified port.
[in] | listeningPort | The local port the server should listen on |
[in] | maxClients | Optional, the maximum simultaneous connected clients, 0 is default, 1-8 valid range |
[in] | irqPin | Optional, Data available external interrupt pin. See registerSocketIrqHandler() for more info |
WiconnectResult wiconnect::SocketInterface::tcpServerStop | ( | void | ) |
Stop TCP server from listening on port. Close all connected clients.