On 06/11/2010 05:16 PM, Holger Hans Peter Freyther wrote:
+    payloadSize [
+       <comment: 'I determine the payload size.'>
+        <category: 'accessing'>
+        dataSize isNil
+           ifTrue: [^data size]
+           ifFalse: [^dataSize]
+    ]

Just name it "size" please. There is no <comment: ''> pragma in methods. Finally, please put a single ^ outside the if blocks.

However, this part is good to commit for 3.2.1.

      get [
        "Parse the data attached to the datagram through a newly created
         ObjectDumper, and answer the resulting object.  This method is
diff --git a/packages/sockets/Sockets.st b/packages/sockets/Sockets.st
index a279c42..a1033ee 100644
--- a/packages/sockets/Sockets.st
+++ b/packages/sockets/Sockets.st
@@ -631,6 +631,20 @@ but it is done for cleanliness and symmetry.'>
        port: remotePort
      ]

+    DatagramSocket class>>  addressFromString: ipAddressOrString [
+       | addr |
+
+       ipAddressOrString isString
+           ifTrue: [
+               addr := SocketAddress byName: ipAddressOrString.
+               addr isNil
+                   ifTrue:
+                       [self error: 'cannot resolve host name ' , 
ipAddressOrString printString]]
+           ifFalse: [addr := ipAddressOrString].
+
+       ^ addr
+    ]
+

This should go to a (very high) superclass as you suspected.

Paolo

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

Reply via email to