Sockets in Squeak
Lex Spoon
lex at cc.gatech.edu
Thu Dec 7 19:17:19 UTC 2000
By the way, most apps will want to use ConnectionQueue on servers. I
guess Socket should have a comment to this effect. ConnectionQueue will
fall back on older listening mechanisms if they are available.
ConnectionQueue would also be a nice place to put a replacement socket
implementation like the one on swiki.net, should you want to do so.
-Lex
"Peter Schuller" <peter.schuller at infidyne.com> wrote:
> Hello,
>
> I have yet another question.
>
> I am experimenting some with sockets. However, I have not been able to
> accept incoming connections! Consider the following piece of code jotted
> down in the Workspace:
>
> |socket|
>
> socket _ Socket new.
> socket listenOn: 1234.
> (Delay forSeconds: 10) wait.
> socket accept. "I don't care about the returned socket right now"
>
> The delay is for debugging. I can indeed connect once using standard telnet,
> but once "socket accept." gets executed I get a "primitive has failed".
> Debugging hasn't given me any clues to why. I assume this problem is obvious
> for any experienced Squeaker, so I'm not posting any exception details
> unless asked for it.
>
> What am I doing wrong?
>
> In addition to this problem, doing "socket listenOn: 1234 backlogSize: 5."
> yields the same problem except I can't even connect - I get connection
> refused on my first attempt (I initially tried it because the backlog seemed
> to be set to 1 by default - I could only connect to the port once).
>
> Are there perhaps any hands-on tutorials for this kind of thing? I haven't
> found any at squeak.org nor the Swiki.
>
> Thanks!
>
> --
> / Peter Schuller, InfiDyne Technologies HB
>
> PGP userID: 0x5584BD98 or 'Peter Schuller <peter.schuller at infidyne.com>'
> Key retrival: Send an E-Mail to getpgpkey at scode.infidyne.com
> E-Mail: peter.schuller at infidyne.com Web: http://scode.infidyne.com
More information about the Squeak-dev
mailing list
|