Problems with sockets on 3.7alpha #5423

Ian Piumarta ian.piumarta at inria.fr
Tue Sep 30 01:37:18 UTC 2003


Hi Phil,

On Sun, 28 Sep 2003, Phil Hargett wrote:
> Currently using image 3.7alpha #5423, VM built from SourceForge sources
> and running on Mac OSX.

Could you verify the timestamps in sqUnixSocket.c and aio.c?  They should
be:

  sqUxSock.c:	 * Last edited: Tue Sep 30 03:37:08 2003 by piumarta (Ian Piumarta) on tif
  aio.c:	 * Last edited: 2003-08-23 23:13:02

if not then you have bad (maybe incompatible) source files.

(SF is *not* reliable [it has inconsistent latencies on commits showing up
on the pserver -- which is unfortunate when changes in two places are
mutually dependent].  The source tarballs that I distribute *are*
reliable.  Seems like the 100th time I've said this...)

> Trying to do simple network programming: have a client open a socket
> connection to a server (both Squeak processes, both in the same VM).
> What's very strange is that the client code thinks it's connected
> (e.g., makes it through the segment of code above), but the server
> never does.

I _cannot_ reproduce this on OSX.  Attached are the two "doit"s that I
fire off in workspaces, after which the Transcript shows:

  listening
  accepted a Socket[connected] from a Socket[waitingForConnection]
  connected a Socket[connected]

Could you do some combination of the following?

  1) Try again using my "doit"s and verify it still doesn't work for you?

  2) Send me a complete example of the code that breaks for you, that
     I can run immediately "out of the attachment"?

  3) Rebuild the VM using the tarball source and/or use the precompiled
     3.6 VM for Darwin?

Thanks!

Ian

PS: If this really is a problem in the socket code then I should fix it,
    and we shouldn't play ostrich by patching a different socket
    implementation into the VM.  But for that I need your input (even if
    your code is working now using the Mac socket support).

---------------- server

| port timeout serverSocket clientSocket |
[
port := 5131.
timeout := 10000.
serverSocket := Socket newTCP.
serverSocket listenOn: port backlogSize: 30.
Transcript cr; show: 'listening'.
clientSocket := serverSocket waitForAcceptFor: timeout ifTimedOut: [nil].
Transcript cr; show: 'accepted ' , clientSocket printString, ' from ' , serverSocket printString.
(Delay forSeconds: 2) wait.
serverSocket close; destroy.
clientSocket close; destroy.
] fork.

---------------- client

| timeout machine port socket |
timeout := 10000.
machine := #(127 0 0 1) asByteArray.
port := 5131.
socket := Socket newTCP.
socket connectTo: machine port: port.
socket waitForConnectionFor: timeout.
Transcript cr; show: 'connected ' , socket printString.
(Delay forSeconds: 2) wait.
socket close; destroy.



More information about the Squeak-dev mailing list