GAddress *GetPeer();
GSocketError SetServer();
GSocket *WaitConnection();
+ int SetReusable();
GSocketError Connect(GSocketStream stream);
GSocketError SetNonOriented();
int Read(char *buffer, int size);
void SetCallback(GSocketEventFlags flags,
GSocketCallback callback, char *cdata);
void UnsetCallback(GSocketEventFlags flags);
+ GSocketError GetSockOpt(int level, int optname, void *optval, int *optlen);
+ GSocketError SetSockOpt(int level, int optname,
+ const void *optval, int optlen);
/* API compatibility functions */
static void _GSocket_Detected_Read(GSocket *socket);
static void _GSocket_Detected_Write(GSocket *socket);
virtual void EventLoop_Install_Callback(GSocketEvent event) = 0;
virtual void EventLoop_Uninstall_Callback(GSocketEvent event) = 0;
public:
-//DFE: We can't protect these data member until the GUI code is updated
-//protected:
-#else //def wxUSE_GSOCKET_CPLUSPLUS
+ /* DFE: We can't protect these data member until the GUI code is updated */
+ /* protected: */
+#else /* def wxUSE_GSOCKET_CPLUSPLUS */
#ifdef __cplusplus
extern "C" {
/* Definition of GSocket */
struct _GSocket
{
-#endif //def wxUSE_GSOCKET_CPLUSPLUS
+#endif /* def wxUSE_GSOCKET_CPLUSPLUS */
int m_fd;
GAddress *m_local;
GAddress *m_peer;
int m_non_blocking;
int m_server;
int m_stream;
- int m_oriented;
int m_establishing;
+ int m_reusable;
unsigned long m_timeout;
/* Callbacks */
}
#endif /* __cplusplus */
#else
-///////////////////////////////////////////////////////////////////////////
-// GSocketBSDGUIShim
+/**************************************************************************/
+/* GSocketBSDGUIShim */
class GSocketBSDGUIShim:public GSocketBSD
{
friend void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *guifunc);
static struct GSocketGUIFunctionsTable *ms_gui_functions;
};
-#endif //ndef wxUSE_GSOCKET_CPLUSPLUS
+#endif /* ndef wxUSE_GSOCKET_CPLUSPLUS */
#ifdef __cplusplus
extern "C" {
}
#endif /* __cplusplus */
-// Compatibility methods to support old C API (from gsocket.h)
+/* Compatibility methods to support old C API (from gsocket.h) */
#ifdef wxUSE_GSOCKET_CPLUSPLUS
inline void GSocket_Shutdown(GSocket *socket)
{ socket->Shutdown(); }
{ return socket->SetServer(); }
inline GSocket *GSocket_WaitConnection(GSocket *socket)
{ return socket->WaitConnection(); }
+inline int GSocket_SetReusable(GSocket *socket)
+{ return socket->SetReusable(); }
inline GSocketError GSocket_Connect(GSocket *socket, GSocketStream stream)
{ return socket->Connect(stream); }
inline GSocketError GSocket_SetNonOriented(GSocket *socket)
{ socket->SetCallback(flags,fallback,cdata); }
inline void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags)
{ socket->UnsetCallback(flags); }
+inline GSocketError GSocket_GetSockOpt(GSocket *socket, int level, int optname,
+ void *optval, int *optlen)
+{ return socket->GetSockOpt(level,optname,optval,optlen); }
+inline GSocketError GSocket_SetSockOpt(GSocket *socket, int level, int optname,
+ const void *optval, int optlen)
+{ return socket->SetSockOpt(level,optname,optval,optlen); }
-#endif //def wxUSE_GSOCKET_CPLUSPLUS
+#endif /* def wxUSE_GSOCKET_CPLUSPLUS */
#ifdef __cplusplus
extern "C" {
#ifndef wxUSE_GSOCKET_CPLUSPLUS
void _GSocket_Detected_Read(GSocket *socket);
void _GSocket_Detected_Write(GSocket *socket);
-#endif //ndef wxUSE_GSOCKET_CPLUSPLUS
+#endif /* ndef wxUSE_GSOCKET_CPLUSPLUS */
/* GAddress */