The
WinSock_API TCP library
(for non TCP speakers)
developed by NetCPlus Internet Solutions
|
LIST OF FUNCTIONS
PROVIDED BY THE LIBRARY
VOID WinSockAPI_Initialize_Library(
HWND hWnd,
BOOL bUseLogging)
Called once to tell the
library it is in use by your application.
int WinSockAPI_Initialize_structure(
WINSOCK_STRUCTURE * wsock_structure)
Initialize the special data
structure used by WinSockAPI to pass data between the library and your
application safely.
BASIC WINSOCK WRAPPERS
int WinSockAPI_Start_Winsock(
WORD wRequestedVersion)
Start a Winsock Session.
VOID WinSockAPI_Stop_Winsock(VOID);
End a Winsock Session
int WinSockAPI_Open_TCP_Socket(
WINSOCK_STRUCTURE * pwsock)
Open a TCP socket, the most
basic requirement in TCP communications.
int WinSockAPI_Open_UDP_Socket(
WINSOCK_STRUCTURE * pwsock)
Open a UDP socket, the most
basic requirement in UDP communications.
int WinSockAPI_Close_Socket(
WINSOCK_STRUCTURE * pwsock,
BOOL bStartWinsock)
Close any TCP or UDP socket.
WINSOCK FUNCTIONALITY
FUNCTIONS
int WinSockAPI_Make_TCP_Connection(
WINSOCK_STRUCTURE * wsock_structure,
BOOL bStartWinsock)
This provides a major piece
of the code required to connect to remote server. It lets you (optionally) start a
Winsock session, open a socket, and finally connect to a specified
server (specified by name or IP address) ready to send and receive data
between your application and the server
int WinSockAPI_Make_UDP_Connection(
WINSOCK_STRUCTURE * wsock_structure,
BOOL bStartWinsock)
As above, but using UDP.
int WinSockAPI_Send_TCP_Request(
WINSOCK_STRUCTURE * pwsock)
Lets you send a data
request, or any other form of packet, of any size of data, to the server
this socket is currently connected to.
int WinSockAPI_Send_UDP_Request(
WINSOCK_STRUCTURE * pwsock)
As above, but using UDP.
BOOL
WinSockAPI_Receive_TCP_Data_To_Memory(
WINSOCK_STRUCTURE * pwsock)
Allows you to receive any
size of data sent on the currently open socket by the server you are
currently connected to. This creates a global memory buffer
containing the data received and passes an unlocked global memory handle
back to your application to use.
int
WinSockAPI_Receive_TCP_Data_To_File(
WINSOCK_STRUCTURE * pwsock)
Similar to the function
above, but allows you to receive any size of data sent on the currently
open socket by the server you are currently connected to. The
difference to the function above is that this writes the data to a file
specified by you, which you can then use in any way you want to .
VOID
WinSockAPI_Get_IPAddress_From_Hostname(
char * hostname,
char *IPAddress)
A very useful function that
allows you to perform a DNS lookup on any type of domain name, and get
the IP address of that domain.
int
WinSockAPI_Get_Host_By_Addr(
char * IPAddress,
char * domain)
The reverse of the above,
but still a very useful function that allows you to perform a DNS lookup
on any IP address, and obtain the domain name for that IP address if one
exists.
|