SENDSTRING() or WRITESTRING() for TCP connection
Posted: Wed Jan 27, 2016 5:00 am
I am using the SMING framework to create a TCP server/client. Looking at the TCP example, I encounter the following code;
I am confused over which function to use to sending TCP data. It seems sendString() and writeString() both do the same job. Under what situation should I use which one?
Code: Select all
bool tcpServerClientReceive (TcpClient& client, char *data, int size)
{
debugf("Application DataCallback : %s, %d bytes \r\n", client.getRemoteIp().toString().c_str(),size );
debugf("Data : %s", data);
client.sendString("sendString data\r\n", false);
client.writeString("writeString data\r\n",0 );
if (strcmp(data,"close") == 0)
{
debugf("Closing client");
client.close();
};
return true;
}
I am confused over which function to use to sending TCP data. It seems sendString() and writeString() both do the same job. Under what situation should I use which one?