more functionality moved to SocketAccessor
authorClaus Gittinger <cg@exept.de>
Wed, 21 May 2003 20:29:06 +0200
changeset 1230 2cfb8c270cb5
parent 1229 b96b65284981
child 1231 ad3aaa474d50
more functionality moved to SocketAccessor
Socket.st
--- a/Socket.st	Wed May 21 20:27:17 2003 +0200
+++ b/Socket.st	Wed May 21 20:29:06 2003 +0200
@@ -2010,22 +2010,11 @@
 !
 
 socketAddressClassForDomain:domain
-    domain == #unix ifTrue:[
-        ^ UDSocketAddress
-    ].
-    domain == #inet ifTrue:[
-        ^ IPSocketAddress
-    ].
-    domain == #inet6 ifTrue:[
-        ^ IPv6SocketAddress
-    ].
-    domain == #appletalk ifTrue:[
-        ^ AppletalkSocketAddress
-    ].
-    domain == #decnet ifTrue:[
-        ^ DecNetSocketAddress
-    ].
-    self error:'unsupported domain'.
+    ^ SocketAddress knownClassFromCode:domain
+
+    "
+     self socketAddressClassForDomain:#inet
+    "
 !
 
 supportedProtocolFamilies
@@ -2034,156 +2023,7 @@
      socket creation may still fail, if your system was built
      without it."
 
-    |list hasIt|
-
-    list := OrderedCollection new.
-
-%{
-#ifdef AF_INET
-%}.
-    list add:#inet.
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_UNIX
-%}.
-    list add:#unix.
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_INET6
-%}.
-    list add:#inet6.   "/ internet v6
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_APPLETALK
-%}.
-    list add:#appletalk.  "/ appletalk
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_DECnet
-%}.
-    list add:#decnet.  "/ dec net
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_NS
-%}.
-    list add:#xns.     "/ Xerox XNS
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_X25
-%}.
-    list add:#x25.     "/ X.25
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_SNA
-%}.
-    list add:#sna.     "/ IBM SNA
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_RAW
-%}.
-    list add:#raw.     "/ ?? RAW packets
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_ISO
-%}.
-    list add:#iso.     "/ ??
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_NETBIOS
-%}.
-    list add:#netbios. "/ ??
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_IPX
-%}.
-    list add:#ipx.     "/ Novell IPX
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_AX25
-%}.
-    list add:#ax25.    "/ Amateur Radio AX.25
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_NETROM
-%}.
-    list add:#netrom.  "/ Amateur Radio NET/ROM
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_BRIDGE
-%}.
-    list add:#bridge.  "/ multiprotocol bridge
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_BSC
-%}.
-    list add:#bsc.     "/ BISYNC 2780/3780
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_ROSE
-%}.
-    list add:#rose.    "/ Amateur Radio X.25 PLP
-%{
-#endif
-%}.
-
-%{
-#ifdef AF_IRDA
-%}.
-    list add:#irda.  "/ infrared
-%{
-#endif
-%}.
-
-
-    ^ list
+    ^ OperatingSystem socketAccessor supportedProtocolFamilies
 
     "
      Socket supportedProtocolFamilies
@@ -4949,5 +4789,5 @@
 !Socket class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.176 2003-05-20 16:27:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.177 2003-05-21 18:29:06 cg Exp $'
 ! !