]> git.tdb.fi Git - libs/net.git/blob - source/net/socket_private.h
fc8b23be4cf118d6e984f89735b43fc5c0345169
[libs/net.git] / source / net / socket_private.h
1 #ifndef MSP_NET_SOCKET_PRIVATE_H_
2 #define MSP_NET_SOCKET_PRIVATE_H_
3
4 #include <msp/io/handle.h>
5 #include "socket.h"
6
7 namespace Msp {
8 namespace Net {
9
10 #ifdef WIN32
11 typedef int socklen_t;
12 #endif
13
14 struct Socket::Private
15 {
16 #ifdef WIN32
17         SOCKET handle;
18 #else
19         int handle;
20 #endif
21
22         /* On POSIX platforms this is the same as the handle.  This might seem
23         strange but it allows the same syntax on both POSIX and Windows. */
24         IO::Handle event;
25
26         int set_option(int, int, const void *, socklen_t);
27         int get_option(int, int, void *, socklen_t *);
28 };
29
30 } // namespace Net
31 } // namespace Msp
32
33 #endif