help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Question regarding DatagramSocket...


From: Holger Hans Peter Freyther
Subject: [Help-smalltalk] Question regarding DatagramSocket...
Date: Fri, 11 Jun 2010 19:25:44 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Thunderbird/3.0.4

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.

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...

3.) Sometimes I see a nil Datagram being returned while I see genuine
traffic with tcpdump... but I will have to trace that part.



do the changes in 1st and 2nd make sense?

        z.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]