Start sockets via fork creates 2 instances?

Raab, Andreas Andreas.Raab at disney.com
Fri Jun 9 19:29:33 UTC 2000


Oh well, I guess I understand now. There are always to 'instances' of Socket
created. One is the socket you're getting back. The second one is used for
finalization (e.g., in case you 'forget' to close the first socket). In most
cases you don't see the second one since it'll get removed if you close the
first socket correctly (which is why you have seen only one after running
this stuff). However, during the lifetime of a socket there is always a
shadow version of it around. Since you have counted the instances of socket
while one was active you have also counted its shadow. Whereas after closing
the socket there you will count only one.

  - Andreas

> -----Original Message-----
> From: Steffen.Mueller at phaidros.com 
> [mailto:Steffen.Mueller at phaidros.com]
> Sent: Friday, June 09, 2000 1:42 AM
> To: squeak at cs.uiuc.edu
> Cc: recipient list not shown
> Subject: RE: Start sockets via fork creates 2 instances?
> 
> 
> Hello Andreas,
> 
> it's correct, if you start the server the stuff runs one. 
> After interrupt,
> show the instances of Socket - you will get one. But if you 
> started the
> server with fork (all instances of Socket must be deleted 
> from image before)
> and you check the instances, you will get more than one.
> 
> Steffen
> 
> -----Original Message-----
> From: Raab, Andreas [mailto:Andreas.Raab at disney.com]
> Sent: Freitag, 9. Juni 2000 10:04
> To: squeak at cs.uiuc.edu
> Subject: RE: Start sockets via fork creates 2 instances?
> 
> 
> Steffen,
> 
> I don't seem to be able to recreate your problem. I tried the
> #remoteTestServer and - having a Transcript open - it showed 
> that the stuff
> gets only run once. Just as an aside I can't see any reason why two
> instances of Socket should be created. Perhaps you're just 
> not looking at
> the right thing?! What gives you the impression that two sockets are
> created?!
> 
>   - Andreas
> 
> PS. Feel free to drop me a mail off list if you got any more trouble.
> 
> > -----Original Message-----
> > From: Steffen.Mueller at phaidros.com 
> > [mailto:Steffen.Mueller at phaidros.com]
> > Sent: Friday, June 09, 2000 12:48 AM
> > To: squeak at cs.uiuc.edu
> > Cc: recipient list not shown
> > Subject: Start sockets via fork creates 2 instances?
> > 
> > 
> > Start sockets via fork creates 2 instances?
> > 
> > Hello
> > 
> > I trying to develop a server-application via sockets. To serve more 
> > than one
> > requests, I started the server with 'forkAt: Processor 
> > highIOPriority' and I
> > got 2 instances of Socket! The example-implementations of Socket 
> > ([Socket
> > remoteTestServerTCP] forkAt: Processor highIOPriority) works same. 
> > Starts
> > the server without 'forkAt:', only one instance will be created.
> > Is this the correct behavior?
> > 
> > Thanks in advance for your ideas 
> > Steffen
> > 
> > 
> > 
> > 
> 





More information about the Squeak-dev mailing list