Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CBWinSock Class Reference

CBWinSock. More...

#include <BWinSock.h>

Inheritance diagram for CBWinSock:

CBSock List of all members.

Public Member Functions

bool Connect (const int8 *address, uint16 port)
 Connect.
bool HostOnPort (uint16 port)
 HostOnPort.
bool BindToPort (uint16 port)
 BindToPort.
void Close ()
 Close.
CBSock * Accept ()
 Accept.
int32 GetLastError ()
 GetLastError.

Protected Member Functions

uint64 SetBlockingMode (bool bBlock)
 SetBlockingMode.
int32 Recv (char *buf, uint32 len, int32 flags, struct sockaddr *from=NULL, int *fromlen=NULL)
 Recv.
int32 Send (const char *msg, uint32 len, int32 flags, struct sockaddr *to=NULL, int tolen=0)
 Send.
uint64 GetPendingBytes ()
 GetPendingBytes.

Detailed Description

CBWinSock.

Description: A buffered socket class for Windows

Limitations: None


Member Function Documentation

CBSock * CBWinSock::Accept (   )  [virtual]
 

Accept.

Description: Accepts an incoming connection.

Returns:
A CBSock that is connected to the incoming connection.
Limitations: NONE

Implements CBSock.

bool CBWinSock::BindToPort (  uint16  port  )  [virtual]
 

BindToPort.

Description: Binds a socket to a port.

Parameters:
port is the server port to connect to.
Returns:
true if the socket was successfully bound.
Limitations: None

Implements CBSock.

void CBWinSock::Close (   )  [virtual]
 

Close.

Description: Closes a socket.

Returns:
Void
Limitations: NONE

Implements CBSock.

bool CBWinSock::Connect (  const int8 *  address,
uint16  port
)  [virtual]
 

Connect.

Description: Connects to a server listening on port.

Parameters:
address the server address to connect to
port is the server port to connect to.
Returns:
true if the connect was successful.
Limitations: None

Implements CBSock.

int32 CBWinSock::GetLastError (   )  [virtual]
 

GetLastError.

Description: Returns the last error code.

Returns:
the last error code.
Limitations: NONE

Implements CBSock.

uint64 CBWinSock::GetPendingBytes (   )  [protected, virtual]
 

GetPendingBytes.

Description: This function gets the number of bytes pending on the socket

Returns:
uint64: The number of bytes pending on the socket
Limitations: None

Implements CBSock.

bool CBWinSock::HostOnPort (  uint16  port  )  [virtual]
 

HostOnPort.

Description: Sets up a server socket to listen on the specified port.

Parameters:
port is the port that this socket should listen on.
Returns:
true if socket is setup to listen on the port.
Limitations: NONE

Implements CBSock.

int32 CBWinSock::Recv (  char *  buf,
uint32  len,
int32  flags,
struct sockaddr *  from = NULL,
int *  fromlen = NULL
)  [protected, virtual]
 

Recv.

Description: This function receives data from the specified socket

Parameters:
s,: The socket to receive on
buf,: The buffer to receive into
len,: The maximum length to receive
flags,: Any flags to pass
Returns:
int32: The CBSOCK_RETURN status if there is an error, or the number of bytes received otherwise.
Limitations: None

Implements CBSock.

int32 CBWinSock::Send (  const char *  msg,
uint32  len,
int32  flags,
struct sockaddr *  to = NULL,
int  tolen = 0
)  [protected, virtual]
 

Send.

Description: This function sends data over the specified socket

Parameters:
s,: The socket to send on
msg,: The message to send
len,: The length to send
flags,: Any flags to pass
Returns:
int32: The CBSOCK_RETURN status if there is an error, or the number of bytes sent otherwise.
Limitations: None

Implements CBSock.

uint64 CBWinSock::SetBlockingMode (  bool  bBlock  )  [protected, virtual]
 

SetBlockingMode.

Description: This function sets the blocking mode of the socket. When in blocking mode, functions like accept and read will not return until the function comletes the expected operation. In non-blocking mode, the functions will simply return if the resources are not avaiable.

Parameters:
bBlock,: True for blocking, false for non-blocking
Returns:
void
Limitations: None

Implements CBSock.


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo