AppletalkSocketAddress.st
changeset 815 cb36489446b2
child 818 2f8331ad12d4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AppletalkSocketAddress.st	Tue Sep 21 01:53:08 1999 +0200
@@ -0,0 +1,125 @@
+"
+ COPYRIGHT (c) 1999 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+
+SocketAddress subclass:#AppletalkSocketAddress
+	instanceVariableNames:'port address'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Sockets'
+!
+
+!AppletalkSocketAddress class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1999 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+!
+
+documentation
+"
+    Instances of AppletalkSocketAddress represent appletalk socket addresses.
+    These consist of a network (2 bytes), a node (1 byte) and a port number.
+
+
+    [author:]
+        Claus Gittinger (cg@exept)
+
+    [see also:]
+
+    [instance variables:]
+
+    [class variables:]
+"
+! !
+
+!AppletalkSocketAddress class methodsFor:'queries'!
+
+hostAddressByName: hostName
+    ^ Socket appletalkAddressOfHost:hostName
+
+    "
+     AppletalkSocketAddress hostAddressByName:'clam'   
+     AppletalkSocketAddress hostAddressByName:'foobar' 
+    "
+
+
+!
+
+hostNameByAddress:anAddress
+    ^ Socket hostWithAppletalkAddress:anAddress
+
+    "
+     AppletalkSocketAddress hostNameByAddress:#[1 2 3].
+    "
+
+! !
+
+!AppletalkSocketAddress methodsFor:'queries'!
+
+hostAddress:anAddress
+    address := anAddress
+
+!
+
+hostName
+    ^ Socket hostWithAppletalkAddress:address
+
+
+!
+
+net
+    ^ address wordAt:1 MSB:true
+
+
+!
+
+net:aNodeAddress
+    address isNil ifTrue:[
+        address := ByteArray new:3
+    ].
+    address at:3 put:aNodeAddress
+
+
+!
+
+node
+    ^ address at:3
+
+
+!
+
+port
+    ^ port
+
+!
+
+portOrName
+    ^ port
+
+! !
+
+!AppletalkSocketAddress class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic2/AppletalkSocketAddress.st,v 1.1 1999-09-20 23:53:08 cg Exp $'
+! !