#REFACTORING
authorStefan Vogel <sv@exept.de>
Thu, 01 Oct 2015 19:05:29 +0200
changeset 3633 3a21f142432e
parent 3632 28303443fc03
child 3634 d702e00e8533
child 3635 b6740437ffb3
#REFACTORING class: Socket changed: #accept #waitForNewConnectionWithTimeout:
Socket.st
--- a/Socket.st	Thu Oct 01 19:04:41 2015 +0200
+++ b/Socket.st	Thu Oct 01 19:05:29 2015 +0200
@@ -1667,15 +1667,7 @@
      This method will suspend the current process if no connection is waiting.
      For ST-80 compatibility"
 
-    |newSock|
-
-    self readWait.
-    newSock := self class new.
-    (newSock primAcceptOn:self blocking:false) ifFalse:[
-	"should raise an error here"
-	^ nil
-    ].
-    ^ newSock
+    ^ self waitForNewConnectionWithTimeout:nil
 
     "
      |sock newSock|
@@ -4147,11 +4139,18 @@
      This method implements the inner wait-primitive of a single-connection
      server application."
 
+    |newSock|
+
     (self readWaitWithTimeout:timeoutSecondsOrNil) ifTrue:[
-	"a timeout occurred - no connection within timeout"
-	^ nil
+        "a timeout occurred - no connection within timeout"
+        ^ nil
     ].
-    ^ self accept.
+    newSock := self class new.
+    (newSock primAcceptOn:self blocking:false) ifFalse:[
+        "should raise an error here"
+        ^ nil
+    ].
+    ^ newSock
 ! !
 
 !Socket class methodsFor:'documentation'!