[NetOS] unc20 TCP/IP connection timeout / Sockets API

Hello,I’m using NetOS60 V2.1, unc20 device from FsForth with NS7520. I want to test the Socket API as following: PC connects to unc20 via winsock TCPIP port and sends a few chars eg. “ABC” to a port of the unc20. The unc20 receives the chars, adds 1 to the chars and sends “BCD” back to the PC. Then the unc20 closes the socket. problem: After about 400 connects from the PC the unc20 device stops connecting and waits about 40 seconds then the next 400 connects from the PC are accepted then unc20 waits for another 40 seconds and so on … questions: Why does the unc20 stop connecting sockets after the 400. connect? - I really need no wait. Is it possible to optimize the connection time of 1 connect? Source of UNC20: #include #include #include #include … if(bind(server_socket, &serverAddr, serverAddr_len) < 0) return; if(listen (server_socket, 1) == 0) { peerAddr_len = sizeof(peerAddr); printf ("Server is ready.
"); for(;:wink: { if((sockfd = accept(server_socket, &peerAddr, &peerAddr_len)) < 0) continue; len=recv(sockfd,message2,10,0); if ( len> 0) { for(l1=0;l1