UDSocketAddress.st
author Claus Gittinger <cg@exept.de>
Tue, 25 Jun 2019 14:28:51 +0200
changeset 5050 44fa8672d102
parent 3987 5507fb2364b2
child 5052 82fd57c1de33
permissions -rw-r--r--
#DOCUMENTATION by cg class: SharedQueue comment/format in: #next #nextWithTimeout:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    13
3463
9be5b04cd3bc class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3054
diff changeset
    14
"{ NameSpace: Smalltalk }"
9be5b04cd3bc class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3054
diff changeset
    15
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
    16
SocketAddress variableByteSubclass:#UDSocketAddress
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
    17
	instanceVariableNames:''
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
    18
	classVariableNames:''
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
    19
	poolDictionaries:''
816
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
    20
	category:'OS-Sockets'
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!UDSocketAddress class methodsFor:'documentation'!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1995 by Claus Gittinger
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
111
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    41
    Instances of UDSocketAddress represent unix-domain socket names.
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    42
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    ST-80 compatibility class.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    This may be required when existing code has to be ported to ST/X;
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    however, it may not be complete and more protocol may be added in the future.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    The code here was created when public domain code (Manchester) had to
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    be ported to ST/X and missing classes/methods were encountered, and code added
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    by reasoning 'what the original class could probably do there'.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    This is an additional goody class; therefore:
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    SUCH DAMAGE.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
!UDSocketAddress class methodsFor:'instance creation'!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
1908
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    68
allForHostName:hostName serviceName:portNrOrName type:socketTypeSymbol
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    69
    (hostName notNil and:[hostName ~= 'localhost']) ifTrue:[
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    70
        self error:'Only local connections possible with UD sockets'.
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    71
        ^ nil.
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    72
    ].
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    73
2165
635929d2fe72 fix #allForHostName:serviceName:type::
Stefan Vogel <sv@exept.de>
parents: 1936
diff changeset
    74
    ^ Array with:(self name:portNrOrName).
1908
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    75
!
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    76
1319
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    77
anyHost
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    78
    "there is nothing like a 'host' for unix domain sockets.
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    79
     answer an empty address"
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    80
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    81
    ^ self new
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    82
!
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
    83
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
name: pathName
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    ^ self new name:pathName
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     UDSocketAddress name:'/tmp/aUnixDomainSocket' 
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "
1259
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    90
!
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    91
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    92
peerName:peerName port:port
1908
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    93
    "use #name:"
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    94
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    95
    <resource: #obsolete>
7d5c6c7d805f Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
    96
    self obsoleteMethodWarning:'use name:'.
1259
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    97
    ^ self name:peerName
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   100
!UDSocketAddress class methodsFor:'queries'!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   101
3054
6a30dfee6c5b changes #domainSymbol to #domain fpr comaptibility with Socket
Stefan Vogel <sv@exept.de>
parents: 3046
diff changeset
   102
domain
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   103
    ^ #'AF_UNIX'
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   104
!
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   105
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   106
obsoleteDomainSymbol
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   107
    ^ #unix
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   108
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   109
1259
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   110
peerNameFromPeer:peer
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   111
    ^ 'localhost'
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   112
!
0a557e59ea4a instance creation refactored
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   113
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   114
vwDomainSymbol
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   115
    ^ #afUnix
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   118
!UDSocketAddress methodsFor:'accessing'!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   119
3046
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   120
hostAddress
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   121
    "unix domain sockets are local and do not have a host address"
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   122
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   123
    ^ nil
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   124
!
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   125
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   126
name
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   127
    ^ self stringAt:3
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   128
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   129
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   130
name:pathName
3463
9be5b04cd3bc class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3054
diff changeset
   131
    self stringAt:3 put:pathName asFilename osNameForFile.
1319
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
   132
!
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
   133
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
   134
port
1936
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   135
    "compatibility with inet sockets"
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   136
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   137
    ^ self name
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   138
!
1319
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
   139
1936
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   140
port:pathName
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   141
    "compatibility with inet sockets"
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   142
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   143
    self name:pathName
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   144
!
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   145
d9cc04bdd113 Clean up:
Stefan Vogel <sv@exept.de>
parents: 1908
diff changeset
   146
portOrName
1319
4b9a0784a799 Protocol compatibility: #anyHost, #port
Stefan Vogel <sv@exept.de>
parents: 1262
diff changeset
   147
    ^ self name
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   148
! !
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   149
3516
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   150
!UDSocketAddress methodsFor:'comparing'!
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   151
3520
669dd5b0ce2e class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3516
diff changeset
   152
sameHostAddress:aSocketAddress
3516
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   153
    "answer true, if myself and aSocketAddress have the same host address
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   154
     (but possibly different ports).
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   155
     UnixDomainSockets are always on the same host."
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   156
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   157
    ^ aSocketAddress class == self class
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   158
! !
be635bb4c2cb class: UDSocketAddress
Stefan Vogel <sv@exept.de>
parents: 3463
diff changeset
   159
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   160
!UDSocketAddress methodsFor:'obsolete'!
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   162
address
3046
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   163
    <resource: #obsolete>
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   164
    ^ nil
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   165
!
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   166
111
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   167
hostName
3046
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   168
    <resource: #obsolete>
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   169
    ^ 'local'
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   170
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   171
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   172
hostName:hostOrPathName port:portNrOrName
3046
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   173
    <resource: #obsolete>
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   174
    self name:hostOrPathName
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   175
! !
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   176
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   177
!UDSocketAddress methodsFor:'printing & storing'!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   178
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   179
printOn:aStream
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   180
    aStream nextPutAll:self class name; 
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   181
            nextPut:$(; nextPutAll:self name; nextPut:$)
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   182
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   183
    "
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   184
     (self name:'/tmp/abcde') printString
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 818
diff changeset
   185
    "
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
1366
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   188
!UDSocketAddress methodsFor:'testing'!
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   189
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   190
isLocal
3987
5507fb2364b2 #OTHER by mawalch
mawalch
parents: 3520
diff changeset
   191
    "answer true, if this address addresses a peer on the same host"
1366
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   192
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   193
    ^ true
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   194
! !
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1319
diff changeset
   195
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   196
!UDSocketAddress class methodsFor:'documentation'!
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   197
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   198
version
3987
5507fb2364b2 #OTHER by mawalch
mawalch
parents: 3520
diff changeset
   199
    ^ '$Header$'
3054
6a30dfee6c5b changes #domainSymbol to #domain fpr comaptibility with Socket
Stefan Vogel <sv@exept.de>
parents: 3046
diff changeset
   200
!
6a30dfee6c5b changes #domainSymbol to #domain fpr comaptibility with Socket
Stefan Vogel <sv@exept.de>
parents: 3046
diff changeset
   201
6a30dfee6c5b changes #domainSymbol to #domain fpr comaptibility with Socket
Stefan Vogel <sv@exept.de>
parents: 3046
diff changeset
   202
version_CVS
3987
5507fb2364b2 #OTHER by mawalch
mawalch
parents: 3520
diff changeset
   203
    ^ '$Header$'
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   204
! !
3046
0b247fe7259d My own address checking
Stefan Vogel <sv@exept.de>
parents: 2165
diff changeset
   205