Hi. I'm trying to use a client socket that connects itself to a server (from KomServices) that's already running in squeak. The socket seems to be created correctly but the connection primitive always fails. I've tried the following statements : Socket newTCP connectTo:'localhost' port:1024 Socket newTCP connectTo:'127.0.0.1' port:1024 Socket createIfFail:[...] connectTo:'localhost' port:1024 Socket createIfFail:[...] connectTo:'127.0.0.1' port:1024
Does someone know why? Thanks in advance.
=?iso-8859-1?b?RnJhbudvaXM=?= THIMON thimof@iutc3.unicaen.fr wrote:
Socket newTCP connectTo:'127.0.0.1' port:1024 Socket createIfFail:[...] connectTo:'localhost' port:1024 Socket createIfFail:[...] connectTo:'127.0.0.1' port:1024
Those functions require a ByteArray containing the 4 bytes of the IP address (though it might be nice if they *did* accept the options you give.... am I missing something?).
You should check out the "example" methods in class OldSocket. It is a pity those methods are in OldSocket instead of Socket, but no one has gotten around to making a changeset to fix it.
-Lex
Quoting Lex Spoon lex@cc.gatech.edu:
=?iso-8859-1?b?RnJhbudvaXM=?= THIMON thimof@iutc3.unicaen.fr wrote:
Socket newTCP connectTo:'127.0.0.1' port:1024 Socket createIfFail:[...] connectTo:'localhost' port:1024 Socket createIfFail:[...] connectTo:'127.0.0.1' port:1024
Those functions require a ByteArray containing the 4 bytes of the IP address (though it might be nice if they *did* accept the options you give.... am I missing something?).
You should check out the "example" methods in class OldSocket. It is a pity those methods are in OldSocket instead of Socket, but no one has gotten around to making a changeset to fix it.
-Lex
Hi, actually I've fixed my problem two days ago by checking as much code as I could. But still thanks for your help. Cheers.
squeak-dev@lists.squeakfoundation.org