182 ConnectStatus(NotConnected)
205 ConnectStatus(NotConnected)
static int MaxPacketSendSize
Defined by the WSAStartup() call return information (WSAData).
TDatagramSocket()
This function does nothing. It relies on TSocket to do all the work.
int Read(char *data, int &charsToRead, TSocketAddress &sAddress)
This function reads the chars into the chData buffer, and removes the data from the queue.
int DoReadNotification(const SOCKET &s, int error)
This function is called whenever the socket receives a read notification.
int Write(char *data, int &charsToWrite, TSocketAddress &outSocketAddress, bool becomeOwnerOfData=true, bool copyData=true)
This function puts the data in the queue and attempts to write the first item in the queue.
int DoWriteNotification(const SOCKET &s, int error)
This function is called whenever the socket receives a write notification.
The TSocketAddress class stores a Winsock socket address.
TSocket encapsulates the basic attributes of a socket.
TSocket & operator=(TSocket &newSocket)
int Protocol
IPPROTO_TCP, etc.
int Type
SOCK_STREAM, etc.
int Family
PF_INET, etc. (this is the protocol family)
virtual void SetSocketStyle(int nNewFamily=PF_INET, int nNewType=SOCK_STREAM, int nNewProtocol=0)
The SetSocketStyle function can be used to set or change some TSocket member data.
virtual void SetPeerSocketAddress(TSocketAddress &newPeerSocketAddress)
The 'myPeerSocketAddress' member variable is useful for Datagram sockets because it allows them to sp...
The TStreamSocket encapsulates a Winsock stream socket.
int Read(char *data, int &charsToRead)
This reads from the already received and queued data.
int Write(char *data, int &charsToWrite, int flags=0, bool becomeOwnerOfData=true, bool copyData=true)
This function writes the buffer into the stream.
int DoOOBNotification(const SOCKET &s, int nError)
This notification appears when OOB data is ready to be received on the socket port.
int Connect()
This function uses myPeerSocketAddress, which needs to be set before calling this function.
int DoReadNotification(const SOCKET &s, int nError)
This function is called when the socket receives a read notification unless there is an error.
TStreamSocket()
This function calls TSocket constructor and initializes the state of the connection to not connected.
int DoCloseNotification(const SOCKET &s, int nError)
This notification gets called when the socket has been closed.
int DoAcceptNotification(const SOCKET &s, int nError)
This notification occurs when a client socket on the network is attempting to connect to you.
@ ConnectPending
Connection is pending.
@ Connected
Currently connected.
@ NotConnected
This socket is not used.
@ Listening
Waiting for a connection.
int WriteOOB(char *data, int &charsToWrite, int nFlags=MSG_OOB, bool becomeOwnerOfData=true, bool copyData=true)
Works just like TStreamSocket::Write(), except it adds in the MSG_OOB into the flags.
TStreamSocket & operator=(TStreamSocket &src)
This function copies the socket connection information.
int ReadOOB(char *data, int &charsToRead)
This function works just like the Read() function, but it works on the OOB queue.
int DoWriteNotification(const SOCKET &s, int nError)
This function is called when the socket receives a write notification.
int Listen(int nMaxQueuedConnections=N_DEF_MAX_QUEUED_CONNECTIONS)
This function puts this socket into a passive "listening" mode.
int Accept(TStreamSocket &socket)
This function will try to accept a connection with the first connecting peer that is waiting in the q...
int DoConnectNotification(const SOCKET &s, int nError)
This means that the connection attempted with a server on the network has completed.
enum owl::TStreamSocket::TConnectStatus ConnectStatus
static int sendto(SOCKET s, LPCSTR buf, int len, int flags, const struct sockaddr *to, int toLen)
static int listen(SOCKET s, int backlog)
static int WSAGetLastError(void)
static SOCKET accept(SOCKET s, struct sockaddr *addr, int *addrLen)
static int connect(SOCKET s, struct sockaddr *name, int nameLen)
static int send(SOCKET s, LPCSTR buf, int len, int flags)
static int recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromLen)
static int recv(SOCKET s, char *buf, int len, int flags)
Object Windows Library (OWLNext Core)
General definitions used by all ObjectWindows programs.
Main header of the Winsock OWL subsystem.