--- a/Socket.st Mon Oct 10 01:54:26 1994 +0100
+++ b/Socket.st Fri Oct 28 04:07:42 1994 +0100
@@ -22,40 +22,9 @@
COPYRIGHT (c) 1992 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.13 1994-10-10 00:52:46 claus Exp $
+$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.14 1994-10-28 03:07:42 claus Exp $
'!
-%{
-#include <stdio.h>
-#include <errno.h>
-
-#ifdef LINUX
-/* kludge to avoid some redefines ... */
-# define _ARPA_NAMESER_H
-# define _NETINET_TCP_H
-#endif
-
-#ifndef transputer
-# include <fcntl.h>
-# include <sys/types.h>
-# ifdef IRIS
- /* no socket.h on 4.0.5h ?!?!? */
-# define AF_UNIX 1
-# define AF_INET 2
-# define SOCK_STREAM 1
-# define SOCK_DGRAM 2
-# define SOCK_RAW 3
-# else
-# include <sys/socket.h>
-# endif
-# include <netdb.h>
-# include <netinet/in.h>
-# if ! (defined(SYSV3) && defined(mc88k))
-# include <netinet/tcp.h>
-# endif
-#endif
-%}
-
!Socket class methodsFor:'documentation'!
copyright
@@ -74,7 +43,7 @@
version
"
-$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.13 1994-10-10 00:52:46 claus Exp $
+$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.14 1994-10-28 03:07:42 claus Exp $
"
!
@@ -176,6 +145,40 @@
"
! !
+!Socket class primitiveDefinitions!
+
+%{
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef LINUX
+/* kludge to avoid some redefines ... */
+# define _ARPA_NAMESER_H
+# define _NETINET_TCP_H
+#endif
+
+#ifndef transputer
+# include <fcntl.h>
+# include <sys/types.h>
+# ifdef IRIS
+ /* no socket.h on 4.0.5h ?!?!? */
+# define AF_UNIX 1
+# define AF_INET 2
+# define SOCK_STREAM 1
+# define SOCK_DGRAM 2
+# define SOCK_RAW 3
+# else
+# include <sys/socket.h>
+# endif
+# include <netdb.h>
+# include <netinet/in.h>
+# if ! (defined(SYSV3) && defined(mc88k))
+# include <netinet/tcp.h>
+# endif
+#endif
+%}
+! !
+
!Socket class methodsFor:'signal access'!
brokenConnectionSignal
@@ -1303,8 +1306,12 @@
This method will suspend the current process if no connection is waiting.
For ST-80 compatibility"
+ |newSock|
+
self readWait.
- ^ self class new acceptOn:self
+ newSock := self class new.
+ (newSock acceptOn:self) ifFalse:[^ nil].
+ ^ newSock
"
|sock newSock|