SocketAddress.st
changeset 816 489e7876ab3e
parent 799 b109b39813b4
child 818 2f8331ad12d4
equal deleted inserted replaced
815:cb36489446b2 816:489e7876ab3e
    12 
    12 
    13 Object subclass:#SocketAddress
    13 Object subclass:#SocketAddress
    14 	instanceVariableNames:''
    14 	instanceVariableNames:''
    15 	classVariableNames:''
    15 	classVariableNames:''
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Compatibility-ST80'
    17 	category:'OS-Sockets'
    18 !
    18 !
    19 
    19 
    20 !SocketAddress class methodsFor:'documentation'!
    20 !SocketAddress class methodsFor:'documentation'!
    21 
    21 
    22 copyright
    22 copyright
    59     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    59     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    60     SUCH DAMAGE.
    60     SUCH DAMAGE.
    61 "
    61 "
    62 ! !
    62 ! !
    63 
    63 
       
    64 !SocketAddress class methodsFor:'instance creation'!
       
    65 
       
    66 hostAddress:addr port:portNr
       
    67     ^ self basicNew hostAddress:addr port:portNr
       
    68 !
       
    69 
       
    70 hostName:name port:portNr
       
    71     ^ self basicNew hostName:name port:portNr
       
    72 ! !
       
    73 
    64 !SocketAddress class methodsFor:'queries'!
    74 !SocketAddress class methodsFor:'queries'!
    65 
    75 
    66 domainCodeFromName:aNameSymbol
    76 domainCodeFromName:aNameSymbol
    67     aNameSymbol == #afUnix ifTrue:[^ #unix].
    77     "this is a compatibility method;
    68     aNameSymbol == #afInet ifTrue:[^ #inet].    
    78      VW returns the internal unix codes here - however, in ST/X,
       
    79      symbols are returned, which are translated later (in Socket)"
       
    80 
       
    81     aNameSymbol == #afUnix      ifTrue:[^ #unix].
       
    82     aNameSymbol == #afInet      ifTrue:[^ #inet].    
       
    83     aNameSymbol == #afIpV6      ifTrue:[^ #inet6].    
       
    84     aNameSymbol == #afAppletalk ifTrue:[^ #appletalk].    
       
    85     aNameSymbol == #afDecnet    ifTrue:[^ #DECnet].    
       
    86     aNameSymbol == #afSna       ifTrue:[^ #sna].    
       
    87     aNameSymbol == #afNs        ifTrue:[^ #xns].    
       
    88     aNameSymbol == #afCcitt     ifTrue:[^ #ccitt].    
       
    89 
    69     "/
    90     "/
    70     "/ could someone tell me which symbols are used in ST-80's SocketAddress class ?
    91     "/ could someone tell me which symbols are used in ST-80's SocketAddress class ?
    71     "/
    92     "/
    72     self error:'no more mimicri implemented yet ...'
    93     self error:'no more mimicri implemented yet ...'
    73 
    94 
    74     "Modified: / 9.1.1998 / 10:03:56 / stefan"
    95     "Modified: / 9.1.1998 / 10:03:56 / stefan"
       
    96 !
       
    97 
       
    98 domainNameFromCode:code
       
    99     "this is a compatibility method;
       
   100      VW expects the internal unix codes here - however, in ST/X,
       
   101      symbols are expected - keeping the numeric values secret (in Socket)"
       
   102 
       
   103     code == #unix      ifTrue:[^ #afUnix].
       
   104     code == #inet      ifTrue:[^ #afInet].
       
   105     code == #inet6     ifTrue:[^ #afIpV6].
       
   106     code == #appletalk ifTrue:[^ #afAppletalk].
       
   107     code == #DECnet    ifTrue:[^ #afDecnet].
       
   108     code == #sna       ifTrue:[^ #afSna].
       
   109     code == #xns       ifTrue:[^ #afNs].
       
   110     code == #ccitt     ifTrue:[^ #afCcitt].
       
   111 
       
   112     "/
       
   113     "/ could someone tell me which symbols are used in ST-80's SocketAddress class ?
       
   114     "/
       
   115     self error:'no more mimicri implemented yet ...'
       
   116 
       
   117 !
       
   118 
       
   119 knownClassFromCode:code
       
   120     "this is a compatibility method;
       
   121      VW expects the internal unix codes here - however, in ST/X,
       
   122      symbols are expected - keeping the numeric values secret (in Socket)"
       
   123 
       
   124     code == #unix      ifTrue:[^ #UDSocketAddress].
       
   125     code == #inet      ifTrue:[^ #IPSocketAddress].
       
   126     code == #inet6     ifTrue:[^ #IPv6SocketAddress].
       
   127     code == #appletalk ifTrue:[^ #AppletalkSocketAddress].
       
   128     code == #DECnet    ifTrue:[^ #DECNetSocketAddress].
       
   129     code == #sna       ifTrue:[^ #SNASocketAddress].
       
   130     code == #xns       ifTrue:[^ #XNSSocketAddress].
       
   131     code == #ccitt     ifTrue:[^ #CCITTSocketAddress].
       
   132 
       
   133     "/
       
   134     "/ could someone tell me which symbols are used in ST-80's SocketAddress class ?
       
   135     "/
       
   136     self error:'no more mimicri implemented yet ...'.
       
   137     ^ #SocketAddress
       
   138 
    75 ! !
   139 ! !
    76 
   140 
    77 !SocketAddress methodsFor:'queries'!
   141 !SocketAddress methodsFor:'queries'!
    78 
   142 
    79 address
   143 address
    91 ! !
   155 ! !
    92 
   156 
    93 !SocketAddress class methodsFor:'documentation'!
   157 !SocketAddress class methodsFor:'documentation'!
    94 
   158 
    95 version
   159 version
    96     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.7 1999-09-02 15:18:54 cg Exp $'
   160     ^ '$Header: /cvs/stx/stx/libbasic2/SocketAddress.st,v 1.8 1999-09-20 23:53:02 cg Exp $'
    97 ! !
   161 ! !