SocketAddress.st
changeset 3466 d54258560694
parent 3322 4cce5a23ce05
child 3515 485a1ec43af4
equal deleted inserted replaced
3465:c15c6d70877f 3466:d54258560694
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libbasic2' }"
    12 "{ Package: 'stx:libbasic2' }"
       
    13 
       
    14 "{ NameSpace: Smalltalk }"
    13 
    15 
    14 UninterpretedBytes variableByteSubclass:#SocketAddress
    16 UninterpretedBytes variableByteSubclass:#SocketAddress
    15 	instanceVariableNames:''
    17 	instanceVariableNames:''
    16 	classVariableNames:'DomainToClassMapping Verbose LastName LastPort LastType LastAddr
    18 	classVariableNames:'DomainToClassMapping Verbose LastName LastPort LastType LastAddr
    17 		LastTime'
    19 		LastTime'
   615 ! !
   617 ! !
   616 
   618 
   617 !SocketAddress methodsFor:'accessing'!
   619 !SocketAddress methodsFor:'accessing'!
   618 
   620 
   619 domainCode
   621 domainCode
       
   622     "this opaquely returns the first two bytes as a short integer;
       
   623      Notice: some systems store the domainCode in those 2 bytes,
       
   624      whereas others (IOS) store the size of the addr-struct in byte 1,
       
   625      and the actual domain code in byte 2"
       
   626 
       
   627     OperatingSystem isOSXlike ifTrue:[
       
   628         ^ self at:2
       
   629     ].
   620     ^ self unsignedShortAt:1
   630     ^ self unsignedShortAt:1
   621 !
   631 !
   622 
   632 
   623 domainCode:anInteger
   633 domainCode:anInteger
   624     self unsignedShortAt:1 put:anInteger
   634     "this opaquely sets the first two bytes as a short integer;
       
   635      Notice: some systems store the domainCode in those 2 bytes,
       
   636      whereas others (IOS) store the size of the addr-struct in byte 1,
       
   637      and the actual domain code in byte 2"
       
   638 
       
   639     OperatingSystem isOSXlike ifTrue:[
       
   640         self at:1 put:self size.
       
   641         self at:2 put:anInteger.
       
   642     ] ifFalse:[ 
       
   643         self unsignedShortAt:1 put:anInteger
       
   644     ].
   625 !
   645 !
   626 
   646 
   627 hostAddress:addressBytes
   647 hostAddress:addressBytes
   628     "generic method, subclasses usually redefine this"
   648     "generic method, subclasses usually redefine this"
   629 
   649 
   827 ! !
   847 ! !
   828 
   848 
   829 !SocketAddress class methodsFor:'documentation'!
   849 !SocketAddress class methodsFor:'documentation'!
   830 
   850 
   831 version
   851 version
   832     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.46 2014-07-10 12:23:59 cg Exp $'
   852     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.47 2015-01-23 23:02:47 cg Exp $'
   833 !
   853 !
   834 
   854 
   835 version_CVS
   855 version_CVS
   836     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.46 2014-07-10 12:23:59 cg Exp $'
   856     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.47 2015-01-23 23:02:47 cg Exp $'
   837 ! !
   857 ! !
   838 
   858