summaryrefslogtreecommitdiff
path: root/comm/Stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'comm/Stream.cc')
-rw-r--r--comm/Stream.cc41
1 files changed, 7 insertions, 34 deletions
diff --git a/comm/Stream.cc b/comm/Stream.cc
index f03e298..16f6bc7 100644
--- a/comm/Stream.cc
+++ b/comm/Stream.cc
@@ -16,6 +16,12 @@
#include <stdlib.h>
#include <sys/socket.h>
+#ifdef __osf__
+extern "C" {
+ int listen (int, int);
+}
+#endif
+
/*?class UchStream
Streams implement reliable point to point connections.
UchStream connections do not keep the message boundaries:
@@ -37,14 +43,8 @@ and thus from \typ{UchChannel}, the virtual functions
\fun{HandleRead} and \fun{HandeWrite} can be used.
?*/
-/*?nextdoc?*/
-UchStream :: UchStream ()
-: UchSocket ()
-{
-}
-
/*?
-These constructors are similar to those of the class \typ{UchSocket}.
+This constructor is similar to that of the class \typ{UchSocket}.
?*/
UchStream :: UchStream (UchAddress* bound, UchAddress* connected)
: UchSocket (bound, connected)
@@ -95,30 +95,3 @@ UchStream :: Listen (int n)
return listen (FilDes (), n);
}
-/*?
-This function implements the Unix system call \fun{accept}.
-The stream socket is first set up (with \fun{Setup}), and then the system call is performed.
-A new dynamically created socket is returned, connected to the address returned by \fun{accept}.
-If the socket could not be set up or a system error occurred, 0 is returned.
-Note that in order to accept connections, the socket must be listen to,
-and thus an address must be bound to it.
-?*/
-UchSocket*
-UchStream :: SockAccept ()
-{
- GEN_ADDR addr;
- int alen = sizeof (addr);
- int fd;
-
- if (! Setup ())
- return (UchSocket*) 0;
-
- if ((fd = accept (FilDes (), &addr.sa, &alen)) < 0)
- return (UchSocket*) 0;
-
- UchSocket* s = new UchSocket (0, UchAddress::Decode (&addr, alen));
- s -> UchChannel :: Open (fd);
- return s;
-}
-
-