Hi
If you are getting a connection reset then it means that the TCP frame is arriving correctly at the destination IP address correctly and also has been seen as a valid TCP frame.
A reset will be sent in several circumstances:
- There is no socket to handle the frame (do you have a socket on the port you are using?)
- there is no socket listening on the port (have you set the socket to the listening state?)
- the socket is already being used (have you set multiple sockets to handle multiple connections to a single port?)
- the SYN has been correctly received but the application/service using the socket refuses to accept the connection (have you set up the call back function to correctly accept connection requests?)
Assuming that you have a debugger, simply put a break point in the TCP reception routine and step through the code. The reason for the RESET should then be clear. In open TCP the routine is called "process_tcp_in()".
Regards
Mark Butcher
www.mjbc.ch
Hi,
Thanks for your repply. I've set the breakpoint in the process_tcp_in() function and the code was enter to this routine:-
sochandle = tcp_mapsocket(frame, &received_tcp_packet);
if(sochandle < 0) {
TCP_DEBUGOUT("ERROR: Processing TCP packet failed\r\n");
tcp_sendreset(&received_tcp_packet, frame->sip);
return(-1);
}
From the routine, the TCP packet received from PC was able to be process, and I don't know why it's comes to here and connot proceed to the following?
From your replied, I'm not sure how to check wheather the functions that you mentioned were been set or not. This is due to I'm just learn how to use the device and not familiar with the Internet protocol. Can you show me how to verified the point that you have mentioned? Thanks.
Regards
kahjoo