SocketWrench .NET Edition

SocketWrench Development Overview

The SocketWrench .NET component can be used to perform a variety of Internet related programming tasks. Although the number of properties, methods and events may appear daunting, once you begin using SocketWrench in your own applications you'll find that the various methods and events are designed to work together in a cohesive fashion. If you are already familiar with using the SocketWrench ActiveX component, then you'll find the SocketWrench .NET interface to be very similar.

Throughout the Developer's Guide there are some general concepts and terminology used that are essential to understanding how SocketWrench works. Each of these concepts is explored in detail, however a general, broad overview can also be useful when you are just getting started.

Protocols

A protocol, in terms of how the word is used in SocketWrench, refers to the rules for how programs communicate with one another over a network. There are low level networking protocols such as TCP and UDP, as well as high level application protocols like FTP and HTTP. It can be helpful to think of a protocol as a sort of language; for two programs to communicate with each other, they must agree upon a protocol and understand how it is implemented.

Connections

The process of establishing a connection enables one program to communicate with another. Connection requests are made by client applications, and accepted by server applications. When the server accepts the connection request, the connection is completed. When you use the Connect method to successfully establish a connection to a server, a client session is created. SocketWrench uses a one-to-one relationship between an instance of a class and a client session. By creating multiple instances of the class, an application can create multiple client/server sessions if necessary. When you use the Listen and Accept methods to accept incoming client connections, a server session is created. As with client-side connections, each server session is handled by a single instance of the class which is typically created dynamically as remote clients connect to the server.

Sessions

A session refers to an active connection between a client and server program. This term is typically used interchangeably with connection; however in some cases a single session may involve multiple network connections, depending on the application protocol being implemented. When the session is no longer needed, the  Disconnect method will terminate the connection to the remote host and release the resources allocated for that session. After that point, the session is no longer valid and subsequent function calls using the class cannot be made until another connection is established.

Authentication

Many servers require that clients authenticate themselves by providing user names and passwords. Different application protocols implement several different types of authentication, and some protocols may support more than one authentication method. It is the responsibility of the application to implement whatever authentication protocol is required by the remote host. If a secure connection is being established with a server, it also may require that a digital certificate (called a client certificate) be provided as part negotiating the secure session. SocketWrench supports the ability to specify client certificates by setting the CertificateName and CertificateStore properties.

Events

Developers who use programming languages such as Visual Basic will find the concept of events and event handling to be very familiar. In general terms, the SocketWrench documentation uses "event" to refer to a mechanism where the control notifies the application that an operation has completed, some action has taken place or a change in status has occurred. One example of an event is the OnConnect event, which is generated whenever an asynchronous network connection is completed by the client. Another example is the OnProgress event, which is generated periodically to inform the application of its progress as it sends or receives data. To determine what events are available based on usage, refer to the technical reference documentation..