|
From: | Paolo Bonzini |
Subject: | Re: [Help-smalltalk] Question regarding DatagramSocket... |
Date: | Fri, 11 Jun 2010 14:29:38 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |