SocketAddress.st
changeset 3047 e9d08555cb5b
parent 2849 c9fe450edc31
child 3051 2d552677dce3
equal deleted inserted replaced
3046:0b247fe7259d 3047:e9d08555cb5b
   508                 domain:#inet type:#stream protocol:nil flags:nil) first socketAddress
   508                 domain:#inet type:#stream protocol:nil flags:nil) first socketAddress
   509          wantHostName:true wantServiceName:true datagram:false flags:0     
   509          wantHostName:true wantServiceName:true datagram:false flags:0     
   510     "
   510     "
   511 !
   511 !
   512 
   512 
       
   513 hostAddressLen
       
   514     "answer the number of bytes of the host address"
       
   515 
       
   516     ^ self subclassResponsibility
       
   517 !
       
   518 
   513 knownClassFromCode:code
   519 knownClassFromCode:code
   514     "this is a compatibility method;
   520     "this is a compatibility method;
   515      VW expects the internal unix codes here - however, in ST/X,
   521      VW expects the internal unix codes here - however, in ST/X,
   516      symbols are expected - keeping the numeric values secret (in Socket)"
   522      symbols are expected - keeping the numeric values secret (in Socket)"
   517 
   523 
   739 
   745 
   740 portOrName
   746 portOrName
   741     ^ self subclassResponsibility
   747     ^ self subclassResponsibility
   742 !
   748 !
   743 
   749 
       
   750 sameHostAddress:aSocketAddress
       
   751     "answer true, if aSocketAddres has the same hostaddress as myself"
       
   752 
       
   753     ^ self class = aSocketAddress class 
       
   754         and:[self hostAddress = aSocketAddress hostAddress] 
       
   755 
       
   756     "
       
   757      (IPSocketAddress hostAddress:#[193 141 12 193] port:80)
       
   758         sameHostAddress:
       
   759      (IPSocketAddress hostAddress:#[193 141 12 193] port:81)
       
   760     "
       
   761 !
       
   762 
   744 serviceName
   763 serviceName
   745     ^ (self class getNameInfo:self wantHostName:false 
   764     ^ (self class getNameInfo:self wantHostName:false 
   746                   wantServiceName:true datagram:false flags:0) second
   765                   wantServiceName:true datagram:false flags:0) second
   747 
   766 
   748     "
   767     "
   755 
   774 
   756 isLocal
   775 isLocal
   757     "answer true, if this address adresses a peer on the same host"
   776     "answer true, if this address adresses a peer on the same host"
   758 
   777 
   759     ^ self subclassResponsibility
   778     ^ self subclassResponsibility
       
   779 !
       
   780 
       
   781 isMyAddress
       
   782     "answer true, if the address refers to my own host.
       
   783      Subclasses may redefine this to check the local configuration, too."
       
   784 
       
   785     ^ self isLocal
   760 ! !
   786 ! !
   761 
   787 
   762 !SocketAddress class methodsFor:'documentation'!
   788 !SocketAddress class methodsFor:'documentation'!
   763 
   789 
   764 version
   790 version
   765     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.37 2012-11-02 18:56:51 cg Exp $'
   791     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.38 2013-07-10 08:22:50 stefan Exp $'
   766 !
   792 !
   767 
   793 
   768 version_CVS
   794 version_CVS
   769     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.37 2012-11-02 18:56:51 cg Exp $'
   795     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.38 2013-07-10 08:22:50 stefan Exp $'
   770 ! !
   796 ! !
       
   797