From: SourceForge.net <no...@so...> - 2004-09-15 00:08:33
|
Bugs item #1028264, was opened at 2004-09-14 19:30 Message generated for change (Comment added) made by dgp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1028264&group_id=10894 Category: 27. Channel Types Group: current: 8.4.7 Status: Open Resolution: None Priority: 5 Submitted By: Don Porter (dgp) Assigned to: Andreas Kupries (andreas_kupries) >Summary: socket: failed write prevents read Initial Comment: Seeing very troubling socket failures only on Windows. (Testing with ActiveTcl 8.4.7.0) First here's a script that implements an echo server on port 1111, it takes a command line argument which adds delays in milliseconds to simulate the server having to attend to other tasks between servicing the socket when idle. ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2004-09-14 20:08 Message: Logged In: YES user_id=80530 Now let the server have delays longer than the client, so that a queue of messages can be waiting to be read by the server. Say a value of 1000 for server.tcl and 200 for client.tcl. Then I see what I like on Solaris. From client.tcl: $ tclsh client.tcl 200 Writing message 1 Writing message 2 Writing message 3 Writing message 4 Writing message 5 Writing message 6 Reply from server: Message 1 received: This is message 1 Writing message 7 Writing message 8 Writing message 9 Writing message 10 Socket closed From server.tcl: $ tclsh server.tcl 1000 [ 1]==>This is message 1 Response: Message 1 received: This is message 1 [ 2]==>This is message 2 Response: Message 2 received: This is message 2 [ 3]==>This is message 3 Response: Message 3 received: This is message 3 [ 4]==>This is message 4 Response: Message 4 received: This is message 4 OUTPUT ERROR on socket sock4: error writing "sock4": broken pipe [ 5]==>This is message 5 [ 6]==>This is message 6 [ 7]==>This is message 7 [ 8]==>This is message 8 [ 9]==>This is message 9 [10]==>This is message 10 INPUT EOF detected on socket sock4; closing socket. Note that server.tcl was able to read all 10 messages from the client. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-09-14 20:05 Message: Logged In: YES user_id=80530 And here is a script that implements a client of that server. It connects to the server and sends and receives messages from it. It also takes a command line argument to add delays between messages it sends, representing time the client program is busy tending to other tasks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1028264&group_id=10894 |