AppletalkSocketAddress.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Jun 2016 17:48:53 +0200
changeset 3928 d1133788cbba
parent 1333 d9ebcc42524c
child 3953 9f54ddb6d684
permissions -rw-r--r--
#OTHER by cg bz2 for windows
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    14
"{ Package: 'stx:libbasic2' }"
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    15
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
    16
SocketAddress variableByteSubclass:#AppletalkSocketAddress
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    17
	instanceVariableNames:''
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
1167
56c172bc5cfe Category change
Stefan Vogel <sv@exept.de>
parents: 1165
diff changeset
    20
	category:'OS-Sockets'
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!AppletalkSocketAddress class methodsFor:'documentation'!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1999 by eXept Software AG
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
              All Rights Reserved
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    Instances of AppletalkSocketAddress represent appletalk socket addresses.
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    These consist of a network (2 bytes), a node (1 byte) and a port number.
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [author:]
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        Claus Gittinger (cg@exept)
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [see also:]
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [instance variables:]
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [class variables:]
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    57
!AppletalkSocketAddress class methodsFor:'addressing'!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    58
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    59
anyNet
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    60
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    61
    ^ 0
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    62
!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    63
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    64
anyNode
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    65
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    66
    ^ 0
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    67
!
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
    68
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    69
anyPort
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    70
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    71
    ^ 0
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    72
!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    73
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    74
firstUnreservedPort
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    75
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    76
   ^ 128
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    77
!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    78
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    79
maxPort
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    80
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    81
   ^ 254   "254 is only legal on localtalk"
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
    82
! !
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
    83
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    84
!AppletalkSocketAddress class methodsFor:'queries'!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    85
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    86
domainSymbol
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    87
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1167
diff changeset
    88
    ^ #'AF_APPLETALK'
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1167
diff changeset
    89
!
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1167
diff changeset
    90
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1167
diff changeset
    91
obsoleteDomainSymbol
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    92
    ^ #appletalk
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    93
!
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    94
1228
b766b9873ba6 refactored & dead code eliminated
Claus Gittinger <cg@exept.de>
parents: 1226
diff changeset
    95
vwDomainSymbol
b766b9873ba6 refactored & dead code eliminated
Claus Gittinger <cg@exept.de>
parents: 1226
diff changeset
    96
    ^ #afAppletalk
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    97
! !
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    98
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
    99
!AppletalkSocketAddress methodsFor:'accessing'!
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
net
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   102
    ^ self unsignedShortAt:4 bigEndian:true
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
net:aNodeAddress
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   106
    self unsignedShortAt:4 put:aNodeAddress bigEndian:true
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   107
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   108
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   109
     self new net:16r1234
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   110
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   111
!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   112
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   113
net:netNr node:nodeNr port:portNr
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   114
    self 
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   115
        net:netNr;
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   116
        node:nodeNr;
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   117
        port:portNr
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   118
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   119
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   120
     AppletalkSocketAddress new net:1234 node:10 port:20
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   121
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   122
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   123
     AppletalkSocketAddress hostAddress:#[1 2 3] port:10
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   124
    "
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   125
!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   126
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   127
node
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   128
    ^ self at:6
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   131
node:aNodeNr
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   132
    self at:6 put:aNodeNr
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
port
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   136
    ^ self at:3
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   139
port:aPortNr
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   140
    self at:3 put:aPortNr
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   141
! !
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   142
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   143
!AppletalkSocketAddress methodsFor:'printing & storing'!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   144
1333
d9ebcc42524c printing refactored
penk
parents: 1262
diff changeset
   145
printAddressOn:aStream
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   146
    self net printOn:aStream.
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   147
    aStream nextPut:$:.
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   148
    self node printOn:aStream.
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   149
! !
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   150
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   151
!AppletalkSocketAddress methodsFor:'queries'!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   152
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
portOrName
1162
c8ba14f81f13 Prepare new socketb implementation
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   154
    ^ self port
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
! !
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
!AppletalkSocketAddress class methodsFor:'documentation'!
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
version
1333
d9ebcc42524c printing refactored
penk
parents: 1262
diff changeset
   160
    ^ '$Header: /cvs/stx/stx/libbasic2/AppletalkSocketAddress.st,v 1.10 2003-10-17 16:42:59 penk Exp $'
815
cb36489446b2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
! !