1 #ifndef MSP_NET_STREAMSOCKET_H_
2 #define MSP_NET_STREAMSOCKET_H_
4 #include "clientsocket.h"
9 class StreamSocket: public ClientSocket
11 friend class StreamServerSocket;
14 /// Used by StreamListenSocket to construct a new socket from accept.
15 StreamSocket(const Private &, const SockAddr &);
17 StreamSocket(Family, int = 0);
19 /** Connects to a remote address. StreamSockets must be connected before
20 data can be sent and received. Returns 0 if the connection was successfully
21 established, 1 if it's in progress.
23 If the socket is non-blocking, this function may return before the
24 connection is fully established. The caller must then use either the
25 poll_connect function or an EventDispatcher to finish the process. */
26 bool connect(const SockAddr &) override;
28 bool poll_connect(const Time::TimeDelta &) override;
31 void on_event(IO::PollEvent);