]> git.tdb.fi Git - libs/net.git/blob - source/streamsocket.h
Style update: spaces around assignments
[libs/net.git] / source / streamsocket.h
1 #ifndef MSP_NET_STREAMSOCKET_H_
2 #define MSP_NET_STREAMSOCKET_H_
3
4 #include "socket.h"
5
6 namespace Msp {
7 namespace Net {
8
9 class StreamSocket: public Socket
10 {
11         friend class StreamListenSocket;
12 private:
13         bool connecting;
14
15 public:
16         /**
17         Emitted when the socket finishes connecting.  The argument is a standard
18         error code, 0 indicating success.
19         */
20         sigc::signal<void, int> signal_connect_finished;
21
22 private:
23         StreamSocket(SocketHandle, const SockAddr &);
24 public:
25         StreamSocket(Family, int = 0);
26
27         bool is_connecting() const { return connecting; }
28         int poll_connect(const Time::TimeDelta &);
29         int connect(const SockAddr &);
30 private:
31         void on_event(IO::PollEvent);
32 };
33
34 } // namespace Net
35 } // namespace Msp
36
37 #endif