*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 01 May 1997 21:00:14 +0200
changeset 532 f997c3873602
parent 531 ca4c73813531
child 533 ced9950b551f
*** empty log message ***
Socket.st
--- a/Socket.st	Thu May 01 20:48:17 1997 +0200
+++ b/Socket.st	Thu May 01 21:00:14 1997 +0200
@@ -391,6 +391,7 @@
 
     TODO: cleanup historic leftovers, implement other than inet domain stuff.
 	  (mhmh - how can I test those ?)
+	  change to raise more signals on errors.
 	  Help - could someone who has a linux machine connected to an appletalk
 	         net please test this (and send bug fixes ...)
 
@@ -1433,6 +1434,190 @@
      Socket typeOfProtocol:(Socket protocolOfService:'nntp')
      Socket typeOfProtocol:(Socket protocolOfService:'echo')
     "
+!
+
+supportedProtocolFamilies
+    "return a collection of supported protocol families.
+     This list specifies what the Socket class supports -
+     socket creation may still fail, if your system was built
+     without it."
+
+    |list hasIt|
+
+    list := OrderedCollection new.
+
+%{
+#ifdef AF_INET
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet].
+
+%{
+#ifdef AF_UNIX
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#unix].
+
+%{
+#ifdef AF_INET6
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet6].
+
+%{
+#ifdef AF_APPLETALK
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#appletalk].
+
+%{
+#ifdef AF_DECnet
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#decnet].
+
+%{
+#ifdef AF_NS
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#xns].
+
+%{
+#ifdef AF_X26
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#x25].
+
+%{
+#ifdef AF_SNA
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#sna].
+
+%{
+#ifdef AF_RAW
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#raw].
+
+%{
+#ifdef AF_ISO
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#iso].
+
+%{
+#ifdef AF_NETBIOS
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#netbios].
+
+%{
+#ifdef AF_IPX
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#ipx].
+
+%{
+#ifdef AF_AX25
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#ax25].
+
+%{
+#ifdef AF_NETROM
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#netrom].
+
+%{
+#ifdef AF_BRIDGE
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#bridge].
+%{
+#ifdef AF_INET
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet].
+%{
+#ifdef AF_INET
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet].
+%{
+#ifdef AF_INET
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet].
+%{
+#ifdef AF_INET
+    hasIt = true;
+#else
+    hasIt = false;
+#endif
+%}.
+    hasIt ifTrue:[list add:#inet].
+
+    ^ list
+
+    "
+     Socket supportedProtocolFamilies
+    "
 ! !
 
 !Socket methodsFor:'ST-80 mimicri'!
@@ -3722,5 +3907,5 @@
 !Socket class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.91 1997-05-01 18:48:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.92 1997-05-01 19:00:14 cg Exp $'
 ! !