X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fstreamsocket.h;h=3fc6d04c4e038acaa53a34f60f8f45ac0dbd4965;hp=3ffe72aa164441f1510c383a7ca322dcdd29d4d3;hb=e6f09239fae7ff675e1068365a06803dcc8f8d1f;hpb=5d91f9edad6e8a11e21979a6aacb4ec6f2dc63ce diff --git a/source/streamsocket.h b/source/streamsocket.h index 3ffe72a..3fc6d04 100644 --- a/source/streamsocket.h +++ b/source/streamsocket.h @@ -1,16 +1,14 @@ #ifndef MSP_NET_STREAMSOCKET_H_ #define MSP_NET_STREAMSOCKET_H_ -#include "socket.h" +#include "clientsocket.h" namespace Msp { namespace Net { -class StreamSocket: public Socket +class StreamSocket: public ClientSocket { - friend class StreamListenSocket; -private: - bool connecting; + friend class StreamServerSocket; public: /** Emitted when the socket finishes connecting. The argument is a @@ -30,14 +28,9 @@ public: If the socket is non-blocking, this function may return before the connection is fully established. The caller must then use either the poll_connect function or an EventDispatcher to finish the process. */ - virtual int connect(const SockAddr &); - - bool is_connecting() const { return connecting; } + virtual bool connect(const SockAddr &); - /** Checks the status of a connection being established. Returns 0 if the - connection was established successfully, 1 if it's still in progress. If - the attempt finished due to an error, an exception is thrown. */ - int poll_connect(const Time::TimeDelta &); + virtual bool poll_connect(const Time::TimeDelta &); private: void on_event(IO::PollEvent);