--- a/Socket.st Wed Sep 15 14:57:37 1999 +0200
+++ b/Socket.st Thu Sep 16 09:37:48 1999 +0200
@@ -726,7 +726,7 @@
Domain must be one of the symbols: #inet, #unix, #ns, #appletalk or #ns;
Type must be #stream, #datagram or #raw
- XXX: currently only the #inet domain is supported"
+ XXX: currently only the #inet and #unix domains is supported"
^ self domain:domainSymbol type:typeSymbol
@@ -785,9 +785,9 @@
connectTo:service on:host
"standard & easy client setup:
- create new client tcp socket, bind and connect;
- return the socket.
- The system may block (interruptable), until the connection is
+ create new client tcp socket, bind and connect;
+ return the socket.
+ The thread block (interruptable), until the connection is
established."
^ (self new) for:host port:(self portOfService:service).
@@ -802,13 +802,13 @@
provide:service
"standard & easy server setup:
- create a new TCP server socket providing a service."
+ create a new TCP server socket providing a service."
|newSock|
newSock := (self new) for:nil port:(self portOfService:service).
newSock notNil ifTrue:[
- newSock listenFor:5.
+ newSock listenFor:5.
].
^ newSock
@@ -886,7 +886,7 @@
"create a new TCP client socket connecting to a service.
Return a socket instance if ok, nil on failure.
If the millis arg is nonNil, stop trying to connect after that many milliseconds
- and return nil.."
+ and return nil."
^ self newTCPclientToHost:aHostAddress port:aService withTimeout:millis
!
@@ -942,8 +942,7 @@
"create a new TCP server socket providing service on
a new anonymous port. The portNr is assigned by the OS."
- ^ self
- newTCPserverAtPort:0
+ ^ self newTCPserverAtPort:0
!
@@ -1009,7 +1008,9 @@
newUNIX
"create a UNIX domain socket - no binding or other setup is done,
- neither connect nor connect-wait is done."
+ neither connect nor connect-wait is done.
+ If the system does not support unix domain sockets (i.e. VMS or MSDOS),
+ return nil."
^ self new domain:#unix type:#stream
@@ -1023,6 +1024,8 @@
Return a socket instance if ok, nil on failure.
Block until a connection is established (but only the current thread;
not the whole smalltalk).
+ If the system does not support unix domain sockets (i.e. VMS or MSDOS),
+ return nil.
See also: #newUNIXclientTo:withTimeout:"
^ self newUNIXclientTo:pathName withTimeout:nil
@@ -1033,16 +1036,18 @@
"create a new UNIX client socket connecting to a pathname.
Return a socket instance if ok, nil on failure.
If the millis arg is nonNil, stop trying to connect after that many milliseconds
- and return nil.."
+ and return nil.
+ If the system does not support unix domain sockets (i.e. VMS or MSDOS),
+ return nil."
|newSock|
newSock := self newUNIX.
newSock notNil ifTrue:[
- (newSock connectTo:pathName port:nil withTimeout:millis) ifFalse:[
- newSock close.
- ^ nil
- ]
+ (newSock connectTo:pathName port:nil withTimeout:millis) ifFalse:[
+ newSock close.
+ ^ nil
+ ]
].
^ newSock
@@ -1054,15 +1059,17 @@
!
newUNIXserverAt:pathName
- "create a new UNIX server socket providing service at a pathname."
+ "create a new UNIX server socket providing service at a pathname.
+ If the system does not support unix domain sockets (i.e. VMS or MSDOS),
+ return nil."
|newSock|
newSock := self newUNIX.
newSock notNil ifTrue:[
- (newSock bindTo:pathName address:nil) ifFalse:[
- ^ nil
- ]
+ (newSock bindTo:pathName address:nil) ifFalse:[
+ ^ nil
+ ]
].
^ newSock
@@ -4193,5 +4200,5 @@
!Socket class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.127 1999-09-15 10:30:57 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.128 1999-09-16 07:37:48 cg Exp $'
! !