as said - second call to tcp_send fails. Other side is pretty standard MFC app, so I don't expect problem to be there....
init_TcpNet (); _tcp_soc = tcp_get_socket (TCP_TYPE_SERVER, 0, 30, tcp_callback); if (_tcp_soc != 0) { /* Start listening on TCP port 900 */ tcp_listen (_tcp_soc, 900); } .... some junk here // this is something I put as a test - fails on second go around while(tcp_check_send(_tcp_soc) == __FALSE) { for(ix = 0; ix < 1000; ++ ix); } maxlen = tcp_max_dsize (_tcp_soc); sendbuf = tcp_get_buf (maxlen); memcpy (sendbuf, data, nLen); tcp_send (_tcp_soc, sendbuf, nLen); _wait_ack = TRUE;
calls are simple
SendToTCP("AAAA",4); SendToTCP("BBBB",4);
what am I missing here?
thank you Mike
* does the function return an error code of some kind? * did you check on the PC side that the connection is indeed alive ('netstat' etc.) ? * did the PC side application crash, or maybe the receiving thread crashes? * are you using a unique TCP stack on the PC side? maybe the message never made it to the application level.
where is your call to 'accept' ? I do see a 'listen' thought. is it embedded in the sectiob ".... some junk here"...? you cannot send anything if the TCP handshake is not complete.
based on this:
http://www.keil.com/forum/docs/thread12195.asp
I don't need to call accept
sorry meant this:
www.keil.com/.../rlarm_tcp_get_socket.htm
:-)