This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

TcpSocket Class Reference

TcpSocket Class Reference

Tcp Socket Class. More...

#include <TcpSocket.h>

Public Member Functions

NyLPC_TiTcpSocket_t * refBaseInstance ()
 wrapped base LPC class.
bool connect (const IpAddr &i_addr, unsigned short i_port)
int precv (const void *&i_rx)
 This function return recieved data and size.
bool canRecv ()
 true if precv has data.
void pseek (unsigned short i_rx_seek)
 This function seek rx pointer to next.

Detailed Description

Tcp Socket Class.

The class is used by Net constructor.

Definition at line 15 of file TcpSocket.h.


Member Function Documentation

bool canRecv (  )

true if precv has data.

This can avoid the block of precv.

Definition at line 41 of file TcpSocket.cpp.

bool connect ( const IpAddr i_addr,
unsigned short  i_port 
)
Parameters:
i_host_addrmust be IPv4 address format.

Definition at line 23 of file TcpSocket.cpp.

int precv ( const void *&  i_rx )

This function return recieved data and size.

The function sets the head of the readable buffer which can always be read. A position is not changed until pseek was called.

Parameters:
i_rxaddress of variable which accepts received data pointer. n<-1 Error n==0 Timeout (connection still established) n>0 Success. readable data size in i_rx.

Definition at line 46 of file TcpSocket.cpp.

void pseek ( unsigned short  i_rx_seek )

This function seek rx pointer to next.

Parameters:
i_rx_sizeseek size. Must be returned value which is small or equal by the precv.

Definition at line 54 of file TcpSocket.cpp.

NyLPC_TiTcpSocket_t* refBaseInstance (  )

wrapped base LPC class.

Definition at line 21 of file TcpSocket.h.