语言

Menu
Sites
Language
Synchronized Server Socket

Hi all,

I have created a server socket and able to get the request from the TCP/IP client via port forwarding. when i try to send the response in the same socket, it fails.Not able to receive at the client side. below is the code to receive data from the socket after accepting the socket connection.

result r = E_SUCCESS;
unsigned long arg = 0;
ByteBuffer rxBuffer;
char data[5000];
if(null != __pCommunicatorSocket)
{
_pCommunicatorSocket->Ioctl(NET_SOCKET_FIONREAD, arg);
rxBuffer.Construct(arg);
r =_pCommunicatorSocket->Receive(rxBuffer);
}
if (r == E_SUCCESS)
{
// Release resource
rxBuffer.Flip();
rxBuffer.GetArray((byte*)data, 0, arg);
data[arg]='\0';
AppLog(data);
}
r = __pCommunicatorSocket->Send(rxBuffer);
rxBuffer.Clear();
 
Can you help me ?
 
Best regards,
Mohan
编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

1 回复
muditha murthy
When it fails what is the error you are getting?