IPSocketAddress.st
author Stefan Vogel <sv@exept.de>
Fri, 28 Mar 2008 13:48:17 +0100
changeset 1937 09fb98759b4a
parent 1909 c76efba26558
child 2172 72f7e3be5d17
permissions -rw-r--r--
Clean up: - inappropriate peer and port settings - method categories
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
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
     3
	      All Rights Reserved
100
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
"
1023
12bc2a0f60b5 + bytesToName:
Claus Gittinger <cg@exept.de>
parents: 818
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
12bc2a0f60b5 + bytesToName:
Claus Gittinger <cg@exept.de>
parents: 818
diff changeset
    13
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
    14
SocketAddress variableByteSubclass:#IPSocketAddress
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
    15
	instanceVariableNames:''
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    16
	classVariableNames:'CacheInvalidationTimeInterval AddressCacheSize NameCacheSize'
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
    17
	poolDictionaries:''
816
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
    18
	category:'OS-Sockets'
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    21
IPSocketAddress class instanceVariableNames:'addrCache nameCache'
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    22
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    23
"
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    24
 No other class instance variables are inherited by this class.
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    25
"
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    26
!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
    27
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!IPSocketAddress class methodsFor:'documentation'!
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
copyright
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
 COPYRIGHT (c) 1995 by Claus Gittinger
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
    33
	      All Rights Reserved
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
111
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    46
    Instances of IPSocketAddress represent tcp/ip-domain socket addresses.
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    47
    These consist of an ip address (4 bytes) and a port number.
92392ae9a0f0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    48
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    49
    Notice that for performance, name and address translations are cached here
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    50
    for some time, in order to speed up heavy lookup such as when operating a webserver or similar
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    51
    application which does many address-to-hostname translations.
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    53
    For systems, when the name translation is fast (unix), you may want to disable it,
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    54
    as it prevents new addresses to be detected for some time (for example, if the own address
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    55
    changes due to a new dhcp address being aquired).
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    56
    You can also change the cacheing-interval time 
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    57
    (see caching protocol, flush*Cache, cachingIntervalTime, *CacheSize).
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    58
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    59
    [author:]
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
    60
        Claus Gittinger
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
"
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    64
!IPSocketAddress class methodsFor:'instance creation'!
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    65
1559
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    66
addressString:aString
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    67
    "convert an address given in a dot notation like 123.456.78.9"
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    68
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    69
    ^ self hostAddress:(self hostAddressFromString:aString).
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    70
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    71
    "
1585
32eba58e5498 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1559
diff changeset
    72
     IPSocketAddress addressString:'1.2.3.4'
1559
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    73
    "
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    74
!
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
    75
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    76
allForHostName:name serviceName:portNrOrName type:socketTypeSymbol
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    77
    "get a collection of new instance given a hostname, port or service and type.
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    78
     Multi-homed hosts return more than one entry
1262
d3daddd36a99 no longer callBack into sockets getHostName/getAddress code.
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
    79
     Redefined to cache the result of the name-lookup."
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    80
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    81
    |addressList|
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    82
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    83
    portNrOrName isString ifTrue:[
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    84
        ^ super allForHostName:name serviceName:portNrOrName type:socketTypeSymbol
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    85
    ].
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    86
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    87
    addressList := self addressCacheAt:name.
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    88
    addressList notNil ifTrue:[
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    89
        addressList := addressList collect:[:eachSocketAddress| |sa|
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    90
            sa := eachSocketAddress copy.
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    91
            portNrOrName notNil ifTrue:[
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    92
                sa port:portNrOrName.
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    93
            ].
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    94
            sa
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    95
        ].
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    96
    ] ifFalse:[
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    97
        addressList := super allForHostName:name serviceName:portNrOrName type:socketTypeSymbol.
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
    98
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
    99
        self addressCacheAt:name put:addressList deepCopy.
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   100
    ].
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   101
    ^ addressList
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   102
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   103
    "
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   104
     SocketAddress allForHostName:'localhost' serviceName:10 type:#stream  
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   105
     IPSocketAddress allForHostName:'localhost' serviceName:'echo' type:#datagram 
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   106
     IPSocketAddress allForHostName:'www.google.com' serviceName:80 type:nil       
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   107
    "
1559
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   108
!
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   109
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   110
localHost
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   111
    "get a new instance representing the local-host address as seen internally"
1559
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   112
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   113
    ^ self hostAddress:(self local) port:self anyPort
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   114
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   115
    "
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   116
     self localHost
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   117
     self localHost hostName
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   118
     self hostName:(OperatingSystem getHostName)      
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   119
    "
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   120
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   121
    "Modified: / 04-06-2007 / 21:34:22 / cg"
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   122
!
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   123
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   124
localHostAddress
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   125
    "NO NO NEVER!!
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   126
     Do not use this, because:
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   127
     1. It does not work on hosts that get their IP address via dhcp (at least on unix/linux)
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   128
     2. Usually OperatingSystem>>#getHostName does not return a fully qualified domain name
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   129
     3. This does not work well on multi-homed hosts"
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   130
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   131
    <resource: #obsolete>
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   132
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   133
    self obsoleteMethodWarning:'Do not use this method'.
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   134
    ^ self hostName:(OperatingSystem getHostName).
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   135
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   136
    "
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   137
      self localHostAddress
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   138
    "
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   139
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   140
1883
2b2f137130ae +localHostAddress
Claus Gittinger <cg@exept.de>
parents: 1877
diff changeset
   141
    "Modified: / 04-06-2007 / 21:17:25 / cg"
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   142
! !
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   143
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   144
!IPSocketAddress class methodsFor:'addressing'!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   145
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   146
anyAddress
1281
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   147
    "return the anonymous addresses bytes"
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   148
1281
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   149
    ^ #[0 0 0 0]
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   150
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   151
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   152
anyPort
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   153
    "return the anon port number"
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   154
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   155
    ^ 0
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   156
!
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
1281
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   158
broadcastAddress
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   159
    "return the broadcast address"
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   160
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   161
    ^ #[255 255 255 255]
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   162
!
6df4f8f211e3 fixed anyHost
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   163
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   164
firstUnreservedPort
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   165
    "return the first unreserved port number"
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   166
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   167
    ^ 1024
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   168
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   169
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   170
local
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   171
    "return IN_ADDR_ANY, the address matching any local address"
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   172
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   173
    ^ #[127 0 0 1]
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   176
maxPort
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   177
    "return the maximum port number"
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   179
    ^ 16rffff
816
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   180
!
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   181
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   182
thisHost
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   183
    "return the bytes of IN_ADDR_ANY, the address matching any local address"
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   184
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   185
    ^ #[0 0 0 0]
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   186
! !
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   187
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   188
!IPSocketAddress class methodsFor:'caching'!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   189
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   190
addressCacheAt:aHostName
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   191
    |addrAndTime addressList time|
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   192
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   193
    addrCache notNil ifTrue:[
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   194
        addrAndTime := addrCache at:aHostName ifAbsent:nil.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   195
        addrAndTime notNil ifTrue:[
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   196
            addressList := addrAndTime key.
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   197
            time := addrAndTime value.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   198
            ((Timestamp now) secondDeltaFrom:time) > self cacheInvalidationTimeInterval ifFalse:[
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   199
                ^ addressList.
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   200
            ]
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   201
        ].
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   202
    ].
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   203
    ^ nil
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   204
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   205
    "Modified: / 26-04-2007 / 11:21:37 / cg"
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   206
!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   207
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   208
addressCacheAt:aName put:anAddressList
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   209
    (addrCache isNil or:[addrCache size > self addressCacheSize]) ifTrue:[
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   210
        addrCache := Dictionary new.
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   211
    ].
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   212
    
1909
c76efba26558 Methods to get all addresses for a given hostname (multihomed hosts)
Stefan Vogel <sv@exept.de>
parents: 1883
diff changeset
   213
    addrCache at:aName put:(anAddressList -> Timestamp now).
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   214
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   215
    "Modified: / 26-04-2007 / 11:23:26 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   216
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   217
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   218
addressCacheSize
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   219
    ^ AddressCacheSize ? 50
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   220
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   221
    "Created: / 26-04-2007 / 11:22:40 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   222
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   223
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   224
addressCacheSize:aNumber
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   225
    AddressCacheSize := aNumber
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   226
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   227
    "Created: / 26-04-2007 / 11:24:05 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   228
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   229
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   230
cacheInvalidationTimeInterval
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   231
    ^ CacheInvalidationTimeInterval ? 30
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   232
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   233
    "Created: / 26-04-2007 / 11:21:31 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   234
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   235
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   236
cacheInvalidationTimeInterval:seconds
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   237
    CacheInvalidationTimeInterval := seconds
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   238
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   239
    "Created: / 26-04-2007 / 11:29:28 / cg"
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   240
!
1261
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   241
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   242
flushAddressCache
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   243
    addrCache := nil
1261
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   244
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   245
    "
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   246
     self flushAddressCache
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   247
    "
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   248
!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   249
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   250
flushNameCache
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   251
    nameCache := Dictionary new.
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   252
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   253
    "
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   254
     self flushNameCache
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   255
    "
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   256
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   257
    "Modified: / 26-04-2007 / 11:25:32 / cg"
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   258
!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   259
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   260
nameCacheAt:aHostAddress
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   261
    |nameAndTime name time|
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   262
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   263
    nameCache notNil ifTrue:[
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   264
        nameAndTime := nameCache at:aHostAddress ifAbsent:nil.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   265
        nameAndTime notNil ifTrue:[
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   266
            name := nameAndTime key.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   267
            time := nameAndTime value.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   268
            ((Timestamp now) secondDeltaFrom:time) > self cacheInvalidationTimeInterval ifFalse:[
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   269
                ^ name.
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   270
            ]
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   271
        ].
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   272
    ].
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   273
    ^ nil
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   274
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   275
    "Modified: / 26-04-2007 / 11:25:11 / cg"
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   276
!
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   277
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   278
nameCacheAt:aHostAddress put:aName
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   279
    (nameCache isNil or:[nameCache size > self nameCacheSize]) ifTrue:[
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   280
        nameCache := Dictionary new.
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   281
    ].
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   282
    
1877
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   283
    nameCache at:aHostAddress put:(aName -> Timestamp now).
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   284
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   285
    "Modified: / 26-04-2007 / 11:23:35 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   286
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   287
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   288
nameCacheSize
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   289
    ^ NameCacheSize ? 50
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   290
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   291
    "Created: / 26-04-2007 / 11:22:44 / cg"
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   292
!
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   293
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   294
nameCacheSize:aNumber
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   295
    NameCacheSize := aNumber
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   296
d143433fd007 cache: decay after some time to allow for dhcp-changing addresses
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
   297
    "Created: / 26-04-2007 / 11:23:49 / cg"
1261
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   298
! !
ce4c9f258766 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   299
1559
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   300
!IPSocketAddress class methodsFor:'conversion'!
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   301
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   302
hostAddressFromString:aString
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   303
    "convert an address given in a dot notation like 123.456.78.9"
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   304
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   305
    |components bytes|
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   306
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   307
    components := aString asCollectionOfSubstringsSeparatedBy:$..
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   308
    components size ~~ 4 ifTrue:[
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   309
        ^ NameLookupError raiseRequestWith:aString errorString:' - bad address string'.
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   310
    ].
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   311
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   312
    bytes := components collect:[:eachComponent| 
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   313
        Integer readFromString:eachComponent onError:[^ NameLookupError raiseRequestWith:aString errorString:' - bad address string'].
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   314
    ].
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   315
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   316
    ^ bytes asByteArray.
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   317
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   318
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   319
    "
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   320
        IPSocketAddress hostAddressFromString:'1.2.3.4'
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   321
        IPSocketAddress hostAddressFromString:'255.255.255.255'
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   322
    "
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   323
! !
609a0707ab22 New: #addressString: to create an instance from a numeric string representation like
Stefan Vogel <sv@exept.de>
parents: 1452
diff changeset
   324
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   325
!IPSocketAddress class methodsFor:'queries'!
816
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   326
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   327
domainSymbol
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   328
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   329
    ^ #'AF_INET'
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   330
!
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   331
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   332
obsoleteDomainSymbol
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   333
    ^ #inet
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   334
!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   335
1226
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   336
vwDomainSymbol
0114bd044aa9 vw compatible domainSymbols (afXXX)
Claus Gittinger <cg@exept.de>
parents: 1164
diff changeset
   337
    ^ #afInet
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
!IPSocketAddress methodsFor:'accessing'!
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   342
hostAddress
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   343
    ^ (ByteArray new:4) replaceFrom:1 to:4 with:self startingAt:5
816
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   344
!
489e7876ab3e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 799
diff changeset
   345
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   346
hostAddress:aByteArray
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   347
    ^ self replaceFrom:5 to:8 with:aByteArray startingAt:1
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   348
!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   349
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   350
port
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   351
    ^ self unsignedShortAt:3 bigEndian:true
818
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   352
!
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   353
2f8331ad12d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   354
port:aPortNr
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   355
    self unsignedShortAt:3 put:aPortNr bigEndian:true
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   356
! !
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   357
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   358
!IPSocketAddress methodsFor:'obsolete'!
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   359
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   360
address
1452
4456e3f3ddb4 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
   361
    <resource: #obsolete>
4456e3f3ddb4 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 1366
diff changeset
   362
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   363
    ^ self hostAddress
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
! !
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
770
32ad77c9ed74 added #printOn:
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
   366
!IPSocketAddress methodsFor:'printing & storing'!
32ad77c9ed74 added #printOn:
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
   367
1333
d9ebcc42524c printing refactored
penk
parents: 1281
diff changeset
   368
printAddressOn:aStream
d9ebcc42524c printing refactored
penk
parents: 1281
diff changeset
   369
    |i1 i2|
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   371
    i1 := self adrBytesStart.
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   372
    i2 := i1 + self numAdrBytes - 1.
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   373
    i1 to:i2 do:[:i | 
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   374
        i ~~ i1 ifTrue:[
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   375
            aStream nextPut:$.
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   376
        ].
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   377
        (self at:i) printOn:aStream
1164
41a2750af1fa New socket support
Stefan Vogel <sv@exept.de>
parents: 1026
diff changeset
   378
    ].
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   379
! !
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   380
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   381
!IPSocketAddress methodsFor:'private'!
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   382
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   383
adrBytesStart
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   384
    ^ 5
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   385
!
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   386
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   387
numAdrBytes
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   388
    ^ 4
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   389
! !
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   390
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   391
!IPSocketAddress methodsFor:'queries'!
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   392
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   393
hostName
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   394
    |addr name|
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   395
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   396
    addr := self hostAddress.
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   397
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   398
    name := self class nameCacheAt:addr.
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   399
    name notNil ifTrue:[^ name].
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   400
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   401
    name := super hostName.
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   402
    name notNil ifTrue:[
1273
03afdf3f895e addrCache and nameCache must be separate for
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   403
        self class nameCacheAt:addr put:name.
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   404
    ].
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   405
    ^ name
1337
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   406
!
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   407
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   408
networkAddress
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   409
    "Extract and return the network address from the host address."
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   410
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   411
    |highAddrByte|
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   412
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   413
    highAddrByte := self at: 5.
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   414
    (highAddrByte bitAnd: 16r80) == 0 ifTrue: [^ByteArray with: highAddrByte].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   415
    (highAddrByte bitAnd: 16rC0) == 16r80 ifTrue: [^ByteArray with: highAddrByte with: (self at: 6)].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   416
    (highAddrByte bitAnd: 16rC0) == 16rC0 ifTrue: [^ByteArray with: highAddrByte with: (self at: 6) with: (self at: 7)].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   417
    ^ self error: 'unknown network class'
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   418
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   419
    "
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   420
     (IPSocketAddress hostName:'exept.eu.org') networkAddress     
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   421
     (IPSocketAddress hostName:'exept.exept.de') networkAddress    
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   422
     (IPSocketAddress hostName:'ibm.com') networkAddress          
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   423
     (IPSocketAddress hostName:'cnn.com') networkAddress          
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   424
    "
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   425
!
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   426
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   427
networkClass
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   428
    "Extract and return the network class (as a symbol) from the host address.
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   429
     Returns one of #classA #classB #classC."
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   430
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   431
    |highAddrByte|
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   432
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   433
    highAddrByte := self at: 5.
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   434
    (highAddrByte bitAnd: 16r80) == 0 ifTrue: [^#classA].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   435
    (highAddrByte bitAnd: 16rC0) == 16r80 ifTrue: [^#classB].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   436
    (highAddrByte bitAnd: 16rC0) == 16rC0 ifTrue: [^#classC].
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   437
    ^ self error: 'unknown network class'
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   438
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   439
    "
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   440
     (IPSocketAddress hostName:'exept.eu.org') networkClass
a6372d6797c7 network queries
Claus Gittinger <cg@exept.de>
parents: 1333
diff changeset
   441
    "
1937
09fb98759b4a Clean up:
Stefan Vogel <sv@exept.de>
parents: 1909
diff changeset
   442
!
09fb98759b4a Clean up:
Stefan Vogel <sv@exept.de>
parents: 1909
diff changeset
   443
09fb98759b4a Clean up:
Stefan Vogel <sv@exept.de>
parents: 1909
diff changeset
   444
portOrName
09fb98759b4a Clean up:
Stefan Vogel <sv@exept.de>
parents: 1909
diff changeset
   445
    ^ self port
1233
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   446
! !
999feaf57b80 cache host translations
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   447
1366
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   448
!IPSocketAddress methodsFor:'testing'!
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   449
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   450
isLocal
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   451
    "answer true, if this address adresses a peer on the same host"
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   452
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   453
    ^ self hostAddress first == 127
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   454
! !
e01d0f6c102a New method #isLocal returning true for local addresses
Stefan Vogel <sv@exept.de>
parents: 1337
diff changeset
   455
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   456
!IPSocketAddress class methodsFor:'documentation'!
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
488
b0c17a5ff8ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
   458
version
1937
09fb98759b4a Clean up:
Stefan Vogel <sv@exept.de>
parents: 1909
diff changeset
   459
    ^ '$Header: /cvs/stx/stx/libbasic2/IPSocketAddress.st,v 1.33 2008-03-28 12:48:17 stefan Exp $'
100
058d9257c30d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
! !