X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamsocket.h;h=8b39e91afd358214168c977e299e01bc714d3e76;hb=21c596567e3b6fd794ed6af73d304ce2bc70e58f;hp=dcc5dbd63c7025751c771ea141c148a197080436;hpb=4feef9d7a2d96668660686d3812973e6f788359a;p=libs%2Fnet.git diff --git a/source/streamsocket.h b/source/streamsocket.h index dcc5dbd..8b39e91 100644 --- a/source/streamsocket.h +++ b/source/streamsocket.h @@ -1,25 +1,18 @@ #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; - -public: - /** Emitted when the socket finishes connecting. The argument is a - platform-dependent error code. */ - sigc::signal signal_connect_finished; + friend class StreamServerSocket; private: /// Used by StreamListenSocket to construct a new socket from accept. - StreamSocket(SocketHandle, const SockAddr &); + StreamSocket(const Private &, const SockAddr &); public: StreamSocket(Family, int = 0); @@ -30,14 +23,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);