Login  Register

Re: Socket>>accept

Posted by Daniel Birkinshaw on Apr 14, 2010; 10:25pm
URL: https://forum.world.st/Socket-accept-tp1839185p1840531.html

I'm running Pharo-1.0-10515-rc3dev10.03.1

On Wed, Apr 14, 2010 at 10:42:08PM +0100, Michael Roberts wrote:

> Hi, what image version are you running?
>
> cheers,
> Mike
>
> On Wed, Apr 14, 2010 at 1:33 AM, Daniel Birkinshaw
> <[hidden email]> wrote:
> > Hi, I'm trying to implement a simple server. What I want the code to do
> > is as follows:
> >
> > * Create a socket and listen on a port
> > * Wait for an incoming connection
> > * When a connection is received, fork a process to deal with it and go
> >  back to waiting for connections.
> >
> > I believe the following code should accomplish this (I have omitted the
> > loop and the fork because I want to get it working for a single
> > connection before I start with multiple connections!):
> >
> >    server := Socket new.
> >    server listenOn: 1234.
> >    client := server accept.
> >
> > However when I run this I get Socket(Object)>>primitiveFailed. Examining the stack trace reveals the source to be this method:
> >
> > Socket>>primAcceptFrom:receiveBufferSize:sendBufSize:semaIndex:
> >    <primitive: 'primitiveSocketAccept' module: 'SocketPlugin'>
> >    ^self primitiveFailed
> >
> > When I take a look in /usr/local/lib/squeak/3.11.3-2135 there are lots of plugins, but no SocketPlugin. Swazoo seems to work fine without it and all of the tests in the NetworkTests package pass.
> >
> > _______________________________________________
> > Pharo-users mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
> >
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users

_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users