<html>
<head>
<title>PowerSocket Library Version 2.1</title>
</head><body><CENTER>
<h1>The <b>PowerSocket</b>
Library</h1>
<h2>Network Programming using PowerBuilder<br>and Winsock Version 1.1<br></h2><H3>PowerSocket Version 2.1 - January 8, 1999</H3></CENTER>
<hr><H1>Table of Contents</H1><ul><li><a href="#Authors">Authors,
Copyright, and Purchasing information</a><li><a href="#GettingStarted">Getting Started</a>
<li><a href="#WinsockUserObject">Winsock User Object</a> Functions
<ul>
<li><a href="#HtoNL">htonl()</a> Convert an unsigned long value from host byte order to
network byte order.<p></p> <li><a href="#HtoNS">htons()</a> Convert an integer value from host byte order to
network byte order.<p></p> <li><a href="#InetAddr">inet_addr()</a> Convert a string containing an IP address in the
Internet standard ``.'' notation to an unsigned long value in network
byte order.<p></p> <li><a href="#InetNtoA">inet_ntoa()</a> Convert an unsigned long value in network byte
order to the string equivalent IP address in Internet standard ``.''
notation.<p></p> <li><a href="#NtoHL">ntohl()</a> Convert an unsigned long value from network byte order
to host byte order.<p></p> <li><a href="#NtoHS">ntohs()</a> Convert an integer value from network byte order to
host byte order.<p></p> <li><a href="#Select">wsselect()</a> Perform synchronous I/O multiplexing.<p></p> <li><a href="#GetHostByAddr">gethostbyaddr()</a> Retrieve the name(s) and address corresponding
to an IP address provided as an unsigned long value in network byte
order.<p></p> <li><a href="#GetHostByName">gethostbyname()</a> Retrieve the name(s) and address corresponding
to a host name.<p></p> <li><a href="#GetHostName">gethostname()</a> Retrieve the name of the local host.<p></p>
<li><a href="#GetProtoByName">getprotobyname()</a> Retrieve the protocol name and number
corresponding to a protocol name.<p></p> <li><a href="#GetProtoByNumber">getprotobynumber()</a> Retrieve the protocol name and number
corresponding to a protocol number.<p></p> <li><a href="#GetServByName">getservbyname()</a> Retrieve the service name and port
corresponding to a service name.<p></p> <li><a href="#GetServByPort">getservbyport()</a> Retrieve the service name and port
corresponding to a port.<p></p> <li><a href="#CancelAsyncRequest">WSACancelAsyncRequest()</a> Cancel an outstanding instance of a <b>WSAAsyncGetXByY()</b> function.<p></p> <li><a href="#CancelBlockingCall">WSACancelBlockingCall()</a> Cancel an outstanding
"blocking" API call<p></p> <li><a href="#GetLastError">WSAGetLastError()</a> Obtain details of last Windows Sockets API
error<p></p> <li><a href="#IsBlocking">WSAIsBlocking()</a> Determine if the underlying Windows Sockets
DLL is already blocking an existing call for this thread<p></p> <li><a href="#SetLastError">WSASetLastError()</a> Set the error to be returned by a subsequent <b>WSAGetLastError()</b><p></p> <li><a href="#AsyncGetHostByAddr">WSAAsyncGetHostByAddr()</a> Get host information corresponding to
an address - asynchronous version<p></p>
<li><a href="#AsyncGetHostByName">WSAAsyncGetHostByName()</a> Get host information corresponding to
a hostname - asynchronous version.<p></p>
<li><a href="#AsyncGetProtoByName">WSAAsyncGetProtoByName()</a> Get protocol information
corresponding to a protocol name - asynchronous version.<p></p>
<li><a href="#AsyncGetProtoByNumber">WSAAsyncGetProtoByNumber()</a> Get protocol information
corresponding to a protocol number - asynchronous version.<p></p>
<li><a href="#AsyncGetServByName">WSAAsyncGetServByName()</a> Get service information corresponding
to a service name and protocol -- asynchronous version.<p></p>
<li><a href="#AsyncGetServByPort">WSAAsyncGetServByPort()</a> Get service information corresponding
to a port and protocol - asynchronous version.<p></p>
<li><a href="#return_hostent">return_hostent()</a> Read a string buffer containing a hostent
structure and return a pbhostent structure.<p></p>
<li><a href="#return_servent">return_servent()</a> Read a string buffer containing a servent
structure and return a pbservent structure.<p></p>
<li><a href="#return_protoent">return_protoent()</a> Read a string buffer containing a protoent
structure and return a pbprotoent structure.<p></p>
<li><a href="#WSAgetselecterror">WSAGetSelectError()</a> Return the upper 16 bits (the error code
portion) of the <i>LongParm</i> value passed as a
parameter.<p></p>
<li><a href="#WSAgetselectevent">WSAGetSelectEvent()</a> Return the lower 16 bits (the network
event code portion) of the
<i>LongParm</i> value
passed as a parameter.<p></p>
<li><a href="#WSAgetasyncbuflen">WSAGetAsyncBufLen()</a> Return the lower 16 bits (the required
buffer length portion) of the
<i>LongParm</i> value
passed as a parameter.<p></p>
<li><a href="#WSAgetasyncerror">WSAGetAsyncError()</a> Return the upper 16 bits (the error code
portion) of the <i>LongParm</i> value passed as a
parameter.<p></p>
<li><a href="#WSOr">WSOr()</a>
Perform a binary OR operation on two integers and return the result.<p></p>
<li><a href="#UnhookBlockingHook">WSAUnhookBlockingHook()</a> Restore the original blocking hook
function.<p></p></li> </ul>
<li><a href="#SocketUserObject">Socket User Object</a>
<ul> <li><a href="#Accept">accept()</a> An incoming connection is acknowledged and associated
with an immediately created socket. The original socket is returned to
the listening state.<p></p> <li><a href="#Bind">bind()</a>
Assign a local name to an unnamed socket.<p></p> <li><a href="#CloseSocket">closesocket()</a> Remove a socket descriptor from the per-process
object reference table. Only blocks if SO_LINGER is set.<p></p> <li><a href="#Connect">wsconnect()</a> Initiate a connection on the specified socket.<p></p> <li><a href="#GetPeerName">getpeername()</a> Retrieve the name of the peer connected to the
specified socket descriptor.<p></p> <li><a href="#GetSockName">getsockname()</a> Retrieve the current name for the specified
socket<p></p> <li><a href="#GetSockOpt">getsockopt()</a> Retrieve options associated with the specified
socket descriptor.<p></p> <li><a href="#IOCTLSocket">ioctlsocket()</a> Provide control for descriptors.<p></p> <li><a href="#Listen">listen()</a> Listen for incoming connections on a specified
socket.<p></p> <li><a href="#Recv">recv()</a>
Receive data from a connected socket.<p></p> <li><a href="#RecvFrom">recvfrom()</a> Receive data from either a connected or unconnected
socket.<p></p> <li><a href="#Send">send()</a>
Send data to a connected socket.<p></p> <li><a href="#SendTo">sendto()</a> Send data to either a connected or unconnected
socket.<p></p> <li><a href="#SetSockOpt">setsockopt()</a> Store options associated with the specified
socket descriptor.<p></p> <li><a href="#Shutdown">shutdown()</a> Shut down part of a full-duplex connection.<p></p> <li><a href="#Socket">socket()</a> Create an endpoint for communication and return a
socket descriptor.<p></p> <li><a href="#AsyncSelect">WSAAsyncSelect()</a> Perform asynchronous version of <b>wsselect()</b><p></p>
<li><a href="#GetSocketNumber">GetSocketNumber()</a><p></p></li> </ul>
<li><a href="#SocketStreamUserObject">SocketStream User Object</a>
<li><a href="#SocketDGramUserObject">SocketDGram User Object</a></li>
</ul><hr><h1><a name="Authors">Authors,
Copyright, and Purchasing</a></h1><h2><A HREF="mailto:jasonc@science.org">Jason Coombs</A></h2>
<ul>
<li><A HREF="http: