CC3200 TCP socket 发送数据时串口提示 - close socket (20) operation failed to transmit all queued packets
CC3200 TCP socket 发送数据时串口收到提示[SOCK ERROR] - close socket (20) operation failed to transmit all queued packets
下面复制串口收到的数据
Default settings: SSID Name: yunpokeji, PORT = 5001, Packet Count = 1, Destination IP: 192.168.31.213
Enter the option to use: Sending TCP packets...
1.1.1.1 2.2.2.2 3.3.3.3 Sent 1 packets successfully
[SOCK ERROR] - close socket (16) operation failed to transmit all queued packets
close socket (16)扣好数字从16到23变化。
看程序是触发了SimpleLinkEvenHandler(),为什么会触发这段代码?
我程序更改的地方主要是动态IP改成静态IP,如下图
发送部分代码 ,定时发送, 一次200个数
你是不是发送数据之后,没有关闭套接字就又开始创建套接字了。这样的话会把8个套接字一下就占满的。
iStatus = sl_Send(iSockID, g_cBsdBuf, sTestBufLen, 0 );
if( iStatus < 0 )
{
UART_PRINT( "iStatus sl_Close %d " ,iStatus);
sl_Close(iSockID);
UART_PRINT( "iStatus sl_Close %d " ,iStatus);
ASSERT_ON_ERROR(SEND_ERROR);
}
delay1();
//}
Report("Sent %u packets successfully\n\r",g_ulPacketCount);
//iStatus = sl_Recv(iSockID, ReceBuf, 50, 0 );
//UART_PRINT( "%d.%d.%d.%d " ,ReceBuf[0],ReceBuf[1],ReceBuf[2],ReceBuf[3]);
iStatus = sl_Close(iSockID);
/ /closing the socket after sending 1000 packets
ASSERT_ON_ERROR(iStatus);
程序上有关闭,
你用SDK里面的tcp_socket的例程测试有没有这个问题呢?