rx_buf_pos = rx_buf;
recv_len = recvfrom(socket,rx_buf,100,0,(struct
sockaddr*)&from_addr,&fromLen);
//recv_len = recv(recv_socket,rx_buf,sizeof(rx_buf),0);
if(recv_len == SOCKET_ERROR)
{
printf("Socket error!!\n");
}
else
{
printf("receive %d bytes from 192.168.1.2\n",recv_len);
}
}
the send packet is normal but the receive code seem to be something
wrong,It doesn't work,if the packet is short the funciton doesn't have
any return,if the packet upto 1024 bytes,the console continuous print
"Your Ethernet MAC address is 00:50:04:ee:0a:0d
Static IP Address is 192.168.1.3"
Another strage phenomenon is that the tcp/ip stack will be failed to
initialize if I remove the second line in the follow task
void SSSSimpleSocketServerTask()
{
int send_socket;
static SSSConn conn;
struct sockaddr_in far_addr;
struct sockaddr_in local_addr;
int recv_socket;
............................
}
And the conn is not used in this task,I don't know why,all the data
code is changed based the simple socket server demo code.
Can anyone give any advice,Thanks!