]> git.tdb.fi Git - libs/net.git/blob - source/net/serversocket.h
Implement an asynchronous name resolver class
[libs/net.git] / source / net / serversocket.h
1 #ifndef MSP_NET_SERVERSOCKET_H_
2 #define MSP_NET_SERVERSOCKET_H_
3
4 #include "socket.h"
5
6 namespace Msp {
7 namespace Net {
8
9 class ClientSocket;
10
11 /**
12 ServerSockets are used to receive incoming connections.  They cannot be used
13 for sending and receiving data.
14 */
15 class ServerSocket: public Socket
16 {
17 protected:
18         ServerSocket(Family, int, int);
19
20 public:
21         virtual void listen(const SockAddr &, unsigned = 4) = 0;
22
23         virtual ClientSocket *accept() = 0;
24 protected:
25         virtual unsigned do_write(const char *, unsigned);
26         virtual unsigned do_read(char *, unsigned);
27 };
28
29 } // namespace Net
30 } // namespace Msp
31
32 #endif