SocketAddress.st
changeset 3521 7c99b949224b
parent 3515 485a1ec43af4
child 3523 66addfd9ee0a
equal deleted inserted replaced
3520:669dd5b0ce2e 3521:7c99b949224b
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1995 by Claus Gittinger
     2  COPYRIGHT (c) 1995 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   678     self subclassResponsibility
   676     self subclassResponsibility
   679 ! !
   677 ! !
   680 
   678 
   681 !SocketAddress methodsFor:'comparing'!
   679 !SocketAddress methodsFor:'comparing'!
   682 
   680 
   683 hasSameHostAddress:aSocketAddress
   681 sameHostAddress:aSocketAddress
   684     "answer true, if myself and aSocketAddress have the same host address
   682     "answer true, if aSocketAddres has the same hostaddress as myself"
   685      (but possibly different ports)."
   683 
   686 
   684     ^ self class = aSocketAddress class 
   687     ^ self subclassResponsibility
   685         and:[self hostAddress = aSocketAddress hostAddress] 
       
   686 
       
   687     "
       
   688      (IPSocketAddress hostAddress:#[193 141 12 193] port:80)
       
   689         sameHostAddress:
       
   690      (IPSocketAddress hostAddress:#[193 141 12 193] port:81)
       
   691     "
   688 ! !
   692 ! !
   689 
   693 
   690 !SocketAddress methodsFor:'hashing'!
   694 !SocketAddress methodsFor:'hashing'!
   691 
   695 
   692 hash
   696 hash
   801 
   805 
   802 portOrName
   806 portOrName
   803     ^ self subclassResponsibility
   807     ^ self subclassResponsibility
   804 !
   808 !
   805 
   809 
   806 sameHostAddress:aSocketAddress
       
   807     "answer true, if aSocketAddres has the same hostaddress as myself"
       
   808 
       
   809     ^ self class = aSocketAddress class 
       
   810         and:[self hostAddress = aSocketAddress hostAddress] 
       
   811 
       
   812     "
       
   813      (IPSocketAddress hostAddress:#[193 141 12 193] port:80)
       
   814         sameHostAddress:
       
   815      (IPSocketAddress hostAddress:#[193 141 12 193] port:81)
       
   816     "
       
   817 !
       
   818 
       
   819 serviceName
   810 serviceName
   820     ^ (self class getNameInfo:self wantHostName:false 
   811     ^ (self class getNameInfo:self wantHostName:false 
   821                   wantServiceName:true datagram:false flags:0) second
   812                   wantServiceName:true datagram:false flags:0) second
   822 
   813 
   823     "
   814     "
   858 ! !
   849 ! !
   859 
   850 
   860 !SocketAddress class methodsFor:'documentation'!
   851 !SocketAddress class methodsFor:'documentation'!
   861 
   852 
   862 version
   853 version
   863     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.48 2015-03-02 22:42:44 stefan Exp $'
   854     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.49 2015-03-02 23:21:37 stefan Exp $'
   864 !
   855 !
   865 
   856 
   866 version_CVS
   857 version_CVS
   867     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.48 2015-03-02 22:42:44 stefan Exp $'
   858     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.49 2015-03-02 23:21:37 stefan Exp $'
   868 ! !
   859 ! !
   869 
   860