10#if !defined(OWL_WSKSOCK_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
24#define WINSOCK_NOERROR (int)0
25#define WINSOCK_ERROR (int)SOCKET_ERROR
27#define N_DEF_MAX_READ_BUFFFER_SIZE 8192
32#define MSG_SOCKET_NOTIFY ((UINT)(WM_USER+301))
33#define FD_ALL (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE)
72 int StartAcceptNotification();
73 int StartRegularNotification();
75 int CancelNotification();
77 TSocket* GetSocketParent()
const;
78 void SetSocketParent(
TSocket* socket);
81 static uint MsgSocketNotification;
109 ShutModeNoRecvSend = 2
119 virtual int CloseSocket();
120 virtual int ShutDownSocket(TShutMode
shutMode = ShutModeNoRecvSend);
129 virtual int CreateSocket();
136 virtual int BindSocket();
142 virtual int StartAcceptNotification();
143 virtual int StartRegularNotification();
145 virtual int CancelNotification();
148 bool SetSaveSocketOnDelete(
bool saveSocket =
true);
150 virtual int ConvertProtocol(
char*
protocol);
155 virtual ulong GetDriverWaitingSize();
156 virtual ulong GetTotalWaitingSize();
173 int SetDebugOption(
bool bDebug);
175 int SetRouteOption(
bool bRoute);
183 int GetDebugOption(
bool&
bDebug);
185 int GetRouteOption(
bool&
bRoute);
216 int SocketsCallCheck(
int error);
220 virtual int DoReadNotification(
const SOCKET& s,
int nError);
221 virtual int DoWriteNotification(
const SOCKET& s,
int nError);
222 virtual int DoOOBNotification(
const SOCKET& s,
int nError);
223 virtual int DoAcceptNotification(
const SOCKET& s,
int nError);
224 virtual int DoConnectNotification(
const SOCKET& s,
int nError);
225 virtual int DoCloseNotification(
const SOCKET& s,
int nError);
269 SocketParent = socket;
The TSocketAddress class stores a Winsock socket address.
TSocket encapsulates the basic attributes of a socket.
virtual void SetNotificationSet(int notificationSet)
Assigns new set of notifications socket will catch.
int GetLastError()
Returns the last error of the socket.
bool SetSaveSocketOnDelete(bool saveSocket=true)
Saves the socket on deletion.
int Protocol
IPPROTO_TCP, etc.
short SaveSocket
Save the socket on deletion?
TSocketWindow Window
Will receive internal notifications and pass them to this class.
int Type
SOCK_STREAM, etc.
int Family
PF_INET, etc. (this is the protocol family)
TShutMode
How to shutdown the socket.
int MaxReadBufferSize
Maximum buffer size.
virtual void SetNotificationWindow(TWindow *windowNotification)
Sets the new notification window.
Derived from TWindow, a private window used to catch notification messages.
void SetNotificationSet(int notificationSet)
Return the set of notifications socket will catch.
TWindow * WindowNotification
A second window that can be notified instead of the Socket.
int GetLastError()
Return the last error on the socket.
TSocket * GetSocketParent() const
DECLARE_RESPONSE_TABLE(TSocketWindow)
void SetSocketParent(TSocket *socket)
int NotificationSet
Types of notification to respond to.
int SelectOptions
We need to keep our own copy of this so we can do an assignment operator.
void SetNotificationWindow(TWindow *windowNotification)
Set the new notification window.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Object Windows Library (OWLNext Core)
TNotificationSet
Enumeration describing the type of event notifications you want to receive for a given socket.
@ NotifyRead
Notification of readiness for reading.
@ NotifyAccept
Notification of incoming connections.
@ NotifyOOB
Notification of the arrival of out-of-band data.
@ NotifyWrite
Notification of readiness for writing.
@ NotifyClose
Notification of socket closure.
@ NotifyAll
All notifications.
@ NotifyNone
No notifications.
@ NotifyConnect
Notification of completed connection.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
Base window class TWindow definition, including HWND encapsulation.
Winsock for OWL subsystem.