Introduction
With the acceptance of TCP/IP as a standard platform-independent network protocol,
and the explosive growth of the Internet, the Windows Sockets API (application
program interface) has emerged as the standard for network programming in the
Windows environment. This document will introduce the basic concepts behind
Windows Sockets programming and get you started with your first application
created with SocketWrench.
SocketWrench is part of a package developed by Catalyst called the SocketTools
Visual Edition. In addition to the comprehensive, but fairly low-level,
access that SocketWrench provides, SocketTools includes components and libraries
for many of the popular Internet application protocols, such as FTP, POP3, SMTP
and HTTP. For more information about the complete SocketTools package, visit
the Catalyst website at www.catalyst.com. It is assumed that the reader is familiar
with Visual Basic and has installed the SocketWrench control. If you're already
familiar with sockets programming, feel free to skip this section.
The Windows Sockets specification was created by a group of companies, including
Microsoft, in an effort to standardize the TCP/IP suite of protocols under Windows.
Prior to Windows Sockets, each vendor developed their own proprietary libraries,
and although they all had similar functionality, the differences were significant
enough to cause problems for the software developers that used them. The biggest
limitation was that, upon choosing to develop against a specific vendor's library,
the developer was "locked" into that particular implementation. A
program written against one vendor's product would not work with another's.
Windows Sockets was offered as a solution, leaving developers and their end-users
free to choose any vendor's implementation with the assurance that the product
will continue to work.
There are two general approaches that you can take when creating a program
that uses Windows Sockets. One is to code directly against the API. The other
is to use a component which provides a higher-level interface to the library
by setting properties and responding to events. This can provide a more "natural"
programming interface, and it allows you to avoid much of the error-prone drudgery
commonly associated with sockets programming. By including the control in a
project, setting some properties and responding to events, you can quickly and
easily write an Internet-enabled application. And because of the nature of custom
controls in general, the learning curve is low and experimentation is easy.
SocketWrench provides a comprehensive interface to the Windows Sockets library
and will be used to build a simple client-server application in the next section
of this document. Before we get started with the control, however, we'll cover
the basic terminology and concepts behind sockets programming in general.