This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
系统sysbios,CPU为TMS320C6748,使用NDK建立网络模块,在TCP.c中设置超时时间为7200s,如下:
/*
* 回调函数 TCP Server Daemon
* * */
int TcpTest(SOCKET s, UINT32 unused)
{
struct timeval to;
。。。
// 配置超时时间 7200s
to.tv_sec = 7200;
to.tv_usec = 0;
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &to, sizeof(to));
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &to, sizeof(to));
。。。
while(1)
{
。。。
}
。。。
}
自有的电路板卡跟电脑连接,板卡为服务器,电脑应用程序为客户端。客户端与服务器建立连接后,客户端每隔30s向服务器发送一次报文,服务器接收到该报文后回传采集的数据。起初系统正常运行,但是程序运行2~3天之后网络模块会停止运行,在电脑(客户端)上也ping不通板卡,此时系统正常运行(打印信息正常)。
在message.c中的线程message_thread要使用send()函数向客户端发送数据,因此使用fdOpenSession和fdCloseSession,代码如下:
void message_thread(UArg arg0, UArg arg1)
{
。。。
fdOpenSession((HANDLE)tsk_message_thread);// tsk_message_thread为线程message_thread的句柄
while(1)
{
。。。// 应用程序,此处省略
Task_sleep(5);
}
fdCloseSession((HANDLE)tsk_message_thread);
}
请问TI的工程师
1、上述情况是什么原因导致的?
2、大多数情况下,哪些因素会导致网络模块停止运行?