10-21-2011 12:38 PM
Hi,
Could someone help?
Why am I getting a library function error
if (ConnectToTCPServer (&g_hconversation, portNum, serverHostName, clientTCP, NULL, 5000) <0
{
return 0;
}
portNum is 5000
serverHostName is 192.168.2.3 and I can ping it.
my clientTCP function is:
int clientTCP (unsigned handle, int event, int error, void *callbackData)
{
char receiveBuf[256] = {0};
int dataSize = sizeof(receiveBuf)-1;
char lineBuf[130];
switch (event)
{
case TCP_DATAREADY:
#if 0
if ((dataSize = ClientTCPRead (g_hconversation, receiveBuf, dataSize, 1000)) < 0)
{
return -1;
}
printf("TCP_DATAREADY received: %s\n",receiveBuf);
#endif
break;
case TCP_DISCONNECT:
if(error)
{
sprintf(lineBuf,"TCP_DISCONNECT received due to error= %d\n", error);
PRINT_DBG(lineBuf);
g_hconversation = INVALID_TCP_HANDLE;
}
else
PRINT_DBG("TCP_DISCONNECT received from TcpServer\n");
break;
default:
printf("default received\n");
break;
}
return 0;
}
10-21-2011 05:11 PM
Hello agyna,
which error are you receiving and where? Does it happens every time you run the code?
10-21-2011 05:39 PM
Sorry, looks like the problem is resolved.
Thanks.