Problems with sockets with 3.6 Carbon VM?

Phil Hargett hargettp at mindspring.com
Wed Oct 8 01:30:13 UTC 2003


Per an earlier note to the list from Ian Pumarta, I checked to see what 
I have for sqUnixSocket.c, and I find that I have the same version that 
I had a few weeks ago:

-rw-r--r--  1 phil  staff  37721 Sep 16 03:56 sqUnixSocket.c

I believe Ian was looking for a September 30th version of this file.   
Also, aio.c reports as:

-rw-r--r--  1 phil  staff   8091 Oct  6 20:11 aio.c

Finally, I checked out Ian's Unix distribution (3.6g2), and I found:

-rw-r--r--  1 phil  staff  37734 Sep 16 14:06 sqUnixSocket.c

and

-rw-r--r--  1 phil  staff  8075 Aug 30 07:04 aio.c

So, don't know which version to use.

I might try aio.c from Ian's distro, to see if that cleans things up.


On Tuesday, October 7, 2003, at 08:19  PM, Phil Hargett wrote:

> Okay, so a few weeks ago I brought up a potential issue with Sockets 
> on the Mac OS X Carbon VM, and, unfortunately, I couldn't rule out my 
> own errors from being the cause.
>
> I've now rebuilt the VM from CVS, just after John McIntosh's 
> announcement of a new VM.  What I've found is that using 2 different 
> SocketPlugin's have different effects, causing the same Smalltalk code 
> to behave differently.  In one case, the code appears to do it's job; 
> in the other, it does not.
>
> Using the Project Builder project found in CVS, the Mac OS Carbon VM 
> uses sqUnixSocket.c for the SocketPlugin; the file sqMacNetwork.c is 
> not included in the build.  After building the VM with the defaults 
> (and following the instructions found in CVS), I then ran the 
> following snippet of code to open a socket:
>
> 	machine := #(127 0 0 1).
> 	port := 5132.
> 	socket := Socket newTCP.
> 	socket connectTo: machine port: port.
> 	socket semaphore wait.
>
> On the receiving end (in the same VM, just another process):
>
> 	serverSocket semaphore wait.
> 		serverSocket isConnected
> 			ifTrue: [peerSocket := serverSocket accept.
> 					peerSocket isConnected: ["Do stuff with this new connection"].
>
> What I've discovered is that in the VM built with sqUnixSocket.c 
> (built by default), is that although the waiting receiver does return 
> from the Socket>>semaphoreWait call, it never receives a connected 
> socket, so it just spins endlessly on the Socket>>semaphoreWait call.
>
> When I build with sqMacNetwork.c instead (*not* the default), a 
> connected socket is returned from the Socket>>accept call, and my code 
> continues processing the connection.
>
> So...am I writing my Smalltalk code incorrect?  Or is there something 
> wrong with the Project Builder project, that it should be using 
> sqMacNetwork.c instead of sqUnixSocket.c when building the Carbon VM?  
> Or is there something up with sqUnixSocket.c?  Something 
> else...perhaps a problem with semaphore handling?
>
> Don't know, although I've eliminated problems with my build process 
> (followed instructions), source code used for the build (pulled from 
> CVS this week), and tested my code in a working VM to ensure it's not 
> just a fluke.
>
> Any insight?
>
>



More information about the Squeak-dev mailing list