Sockets bleiben offen

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Holger Kreißl (hok_at_inormatik.tuchemnitz.de)
Date: 02/19/04


Date: Thu, 19 Feb 2004 17:45:20 +0100

Hi,

hat jemand Erfahrungen mit Windows Sockets sammeln können? Ich hab hier nen
kleinen Webserver, welcher auf einfache HTTP Anfragen reagiert
(CBlockingSocket). Leider ist es aber so, daß die Sockets nicht richtig
geschlossen und wieder freigegeben werden. Laut shutdown und close werden
alle Sockets fehlerlos geschlossen. Jedoch sagt netstat etwas anders:

 ...
 TCP server:80 client:4699 TIME_WAIT
 TCP server:80 client:4701 TIME_WAIT
 TCP server:80 client:4702 TIME_WAIT
 TCP server:80 client:4706 TIME_WAIT
 TCP server:80 client:4707 TIME_WAIT
 TCP server:80 client:4709 TIME_WAIT
...
 TCP server:80 client:4722 TIME_WAIT
 TCP server:80 client:4723 TIME_WAIT
 TCP server:80 client:4724 TIME_WAIT
 TCP server:80 client:4726 TIME_WAIT
 TCP server:80 client:4729 TIME_WAIT
 TCP server:80 client:4731 TIME_WAIT
 TCP server:80 client:4735 TIME_WAIT
 TCP server:80 client:4736 TIME_WAIT
 TCP server:80 client:4738 TIME_WAIT
 TCP server:80 client:4739 TIME_WAIT

Das geht dann soweit das nach einer gewissen Zeit der Server "hängenbleibt",
da unzählige Ports immernoch warten... Vielleicht weiß ja jemand, wie ich
dies verhindern kann?

Der Server soll auch unter WinNT und 9X laufen...

Besten Dank,

Holger Kreißl



Relevant Pages

  • Reliability of Java, sockets and TCP transmissions
    ... I am writing client and server components of an application that communicate using Socket, ServerSocket and TCP. ... So far I have only been able to run the application where the client and server are on the same local machine or separated by an intranet/LAN so I have no results of an internet deployment to report but I have not encountered any IO errors to this point. ... I mean do I need to implement some kind of "advanced" protocol whereby check sums are transmitted along with packets and the packet retransmitted if the check sum is invalid or is all this handled by either the Java sockets or the TCP protocol already? ...
    (comp.lang.java.programmer)
  • Re: Authenticated UDP
    ... i wasn't aware of SSL applied to anything except TCP ... server, and it also needs to service a separate set of HTTP requests. ... TCP sockets do tend to close quickly when closed normally. ... multiple packets that need tobe assembled by the protocol, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Netstat zeigt UDP established
    ... TCP entleihen um das zu implementieren? ... Auch die TCP Programmierschnittstelle mit ihrer Semantik ist im ... Sockets sind eine Abbildung der Protokollsemantik auf die ... anstatt ein passendes einfach neu zu implementieren. ...
    (de.comp.security.misc)
  • Re: open and close many TCP sockets in quick succession
    ... Modern TCP stacks can deal with 10000s of TIME_WAITs without ... SO_REUSEPORT to sockets that use those ports." ... At server side, there is the 'bind', the 'listen' and then the many ...
    (comp.unix.programmer)
  • Re: TCPSocket doesnt detect remote disconnection inmediatelly
    ... rather how TCP sockets work. ... TCP session to tear down as telnet implies, ... Is there a way to detect it in Ruby using TCPSocket? ... its message is sent with PUSH flag enabled? ...
    (comp.lang.ruby)