1 /* -------------------------------------------------------------------------
2 * Project: GSocket (Generic Socket) for WX
4 * Copyright: (c) Guilhem Lavaux
5 * Licence: wxWindows Licence
6 * Purpose: GSocket MSW header
8 * -------------------------------------------------------------------------
11 #ifndef _WX_MSW_GSOCKMSW_H_
12 #define _WX_MSW_GSOCKMSW_H_
14 #include "wx/msw/wrapwin.h"
16 #if defined(__CYGWIN__)
17 //CYGWIN gives annoying warning about runtime stuff if we don't do this
18 # define USE_SYS_TYPES_FD_SET
19 # include <sys/types.h>
22 #if defined(__WXWINCE__) || defined(__CYGWIN__)
26 /* Definition of GSocket */
27 class GSocket
: public GSocketBase
30 GSocket::GSocket(wxSocketBase
& wxsocket
)
31 : GSocketBase(wxsocket
)
38 virtual GSocket
*WaitConnection(wxSocketBase
& wxsocket
);
41 GSocketError
SetServer();
48 GSocketError
Connect(GSocketStream stream
);
49 GSocketError
SetNonOriented();
50 int Read(char *buffer
, int size
);
51 int Write(const char *buffer
, int size
);
52 void SetNonBlocking(bool non_block
);
53 GSocketError WXDLLIMPEXP_NET
GetError();
54 GSocketError
GetSockOpt(int level
, int optname
,
55 void *optval
, int *optlen
);
56 GSocketError
SetSockOpt(int level
, int optname
,
57 const void *optval
, int optlen
);
60 GSocketError
Input_Timeout();
61 GSocketError
Output_Timeout();
62 GSocketError
Connect_Timeout();
63 int Recv_Stream(char *buffer
, int size
);
64 int Recv_Dgram(char *buffer
, int size
);
65 int Send_Stream(const char *buffer
, int size
);
66 int Send_Dgram(const char *buffer
, int size
);
68 /* TODO: Make these protected */
74 #endif /* _WX_MSW_GSOCKMSW_H_ */