This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Renew and reconnect a new TCP connection

Hello
I configure my ARM as an Ethernet server and I open a desire port via tcp_listen and each loop I send data (before that I check "tcp_check_send () " and then start to transmit).my problem is when I close the first connection I can't connect again to this server.


net_initialize();
tcp_soc = tcp_get_socket (TCP_TYPE_SERVER | TCP_TYPE_KEEP_ALIVE, 0, 100, tcp_callback); if (tcp_soc >= 0) {tcp_listen (tcp_soc, 20000);} s=0; while (1) { net_main (); if (tcp_check_send (tcp_soc)){ sendbuf = tcp_get_buf (sizeof(msg)); memcpy (sendbuf, msg, sizeof(msg)); tcp_send (tcp_soc, sendbuf, sizeof(msg)); } }

I check different approaches but I can't.how can renew my connection and waiting for new client?

an other problem is when I close the connection via my pc (as a client) I see my arm still sends packages to my pc(because it's Ethernet led blink such as before) .why doesn't tcp_check_send detect connection is close?

Thanks