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