On 06/11/2010 01:25 PM, Holger Hans Peter Freyther wrote:
Hi all,

I am trying to implement a script to relay UDP messages and have
encountered some problems with it.

1.) DatagramSocket local: '0.0.0.0' port: 23000 will end with an
exception... The document claims that local can be either a string or an
ip...and it fails here:

         addressClass := ipAddress isNil
                     ifTrue: [addressClass]
                     ifFalse: [ipAddress class].

so addressClass will be set to String, and later on "String newSocket"
leads to a messageNotUnderstood...

I have a patch to move the ipAddressOrString code to a method and call
it for the ipAddressOrString and the ipAddress variable. Would we need
this idiom in ServerSocket, StreamSocket as well? I will send a patch later.

Hard to say without seeing the patch. :-)

2.) I am using the DatagramSocket>>next selector to receive the
datagram, I had to increase the default buffersize... but now all
(Datagram>>data)>>size return the size. I looked down into
AbstrackSocketImpl.st and the receive does not check the return value of
TCPrecvfrom at all. I have added a dataSize to Datagram and set the
return value there...

Looks fine.

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to