From a159d11a1f07c5e30fc8d120cd6f035b90e35d66 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 11:17:49 +0000 Subject: Removed useless default constructor --- comm/Stream.cc | 41 +++++++---------------------------------- comm/Stream.h | 4 +--- 2 files changed, 8 insertions(+), 37 deletions(-) (limited to 'comm') 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 #include +#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; -} - - diff --git a/comm/Stream.h b/comm/Stream.h index 3a4282d..a8c4a56 100644 --- a/comm/Stream.h +++ b/comm/Stream.h @@ -20,14 +20,12 @@ class UchStream : public UchSocket { public: - UchStream (); - UchStream (UchAddress*, UchAddress*); + UchStream (UchAddress* = 0, UchAddress* = 0); ~UchStream (); UchStream (const UchStream&); UchChannel* Copy () const; int SockType (); int Listen (int = 5); - UchSocket* SockAccept (); }; #endif /* Stream_H_ */ -- cgit v1.1