]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/serversocket.h
Prepare for assimilating msphttp
[libs/net.git] / source / net / serversocket.h
diff --git a/source/net/serversocket.h b/source/net/serversocket.h
new file mode 100644 (file)
index 0000000..10375f0
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef MSP_NET_SERVERSOCKET_H_
+#define MSP_NET_SERVERSOCKET_H_
+
+#include "socket.h"
+
+namespace Msp {
+namespace Net {
+
+class ClientSocket;
+
+/**
+ServerSockets are used to receive incoming connections.  They cannot be used
+for sending and receiving data.
+*/
+class ServerSocket: public Socket
+{
+protected:
+       ServerSocket(Family, int, int);
+
+public:
+       virtual void listen(const SockAddr &, unsigned = 4) = 0;
+
+       virtual ClientSocket *accept() = 0;
+protected:
+       virtual unsigned do_write(const char *, unsigned);
+       virtual unsigned do_read(char *, unsigned);
+};
+
+} // namespace Net
+} // namespace Msp
+
+#endif