[Newbies] Re: Building a remote countdown clock

Herbert König herbertkoenig at gmx.net
Sun Nov 8 09:00:26 UTC 2009


Hi Andy,

AB> (NetNameResolver addressForName: 'aComputersName') inspect

AB> you should get an Inspector on a ByteArray with the IP address.

AB> Hmmm, I was expecting to get an inspector on a ByteArray, but
AB> what I actually got was an inspector on SocketAddress. Something
AB> is obviously not quite right here! :-)

again not on your side, I tried in Pharo and they introduced a class
SocketAddress.

You have to send that instance the message hostNumber to get the
IP-Address as .... oops ... a String. I surely didn't expect that!

What makes it worse, is that my code works though I hand an Array
as the IP address to Socket. So my best guess is you go to the Pharo
list and ask about the proper way to set up a UDP (or TCP) connection.

I could tell you how to pick the bytes out of SocketAddress but this
is Smalltalk after all. There must be a high level way.

Sorry for no better reply,

Herbert   



More information about the Beginners mailing list