SocketTools .NET Classes
The SocketTools .NET Edition classes implement the most commonly used Internet application protocols such as FTP, HTTP, POP3, IMAP4, SMTP and SSH. It also includes classes for general TCP/IP networking services, parsing MIME e-mail messages, executing remote commands, interactive terminal sessions and much more.
The SocketTools.WebStorage class provides private cloud storage for uploading and downloading shared data files which are available to your application. This is primarily intended for use by developers to store configuration information and other data generated by the application. For example, you may want to store certain application settings, and the next time a user or organization installs your software, those settings can be downloaded and restored.
The SocketTools.DnsClient class enables applications to resolve domain names into Internet addresses using the Domain Name Service (DNS) protocol. It can also provide other information about a domain, such as the name of the mail servers which are responsible for receiving e-mail for users in that domain. This class can be used to query one or more specific nameservers directly, without depending on the default DNS configuration of the local system.
The SocketTools.FileEncoder class provides methods for encoding and decoding binary files, compressing and encrypting data. Data encryption uses AES-256 and the encryption keys are generated using SHA-256. Encoding converts the contents of a compressed and/or encrypted file to printable text. Decoding reverses the process, converting a previously encoded text file back into its original form. The class supports a number of different encoding methods, including support for the base64, uucode, quoted-printable and yEnc algorithms.
The SocketTools.FtpClient class provides methods for uploading and downloading files from a remote host, as well as a variety of remote file management methods using the File Transfer Protocol (FTP). In addition to file transfers, an application can create, rename and delete files and directories, list files and search for files using wildcards. The class provides high level methods, such as the ability to transfer multiple files in a single method call, as well as access to lower level remote file I/O methods. Both standard and secure file transfers are supported using SSH (SFTP), SSL and TLS (FTPS).
The SocketTools.FtpServer class implements a complete, event-driven multithreaded FTP server that can be embedded in your application. It can be used to provide direct access to files, as well as serve as a remote management mechanism using a standard protocol that is widely supported. Designed to work either in a typical desktop application or within a Windows service, the server operates in the background and can support multiple simultaneous client connections. The server supports both standard and secure connections using SSL and TLS. It also provides advanced features such as user isolation, local authentication and support for the SITE EXEC command to allow the execution of external programs and scripts.
The SocketTools.WebLocation class provides your application with geographical information about the physical location of the computer system based on its external IP address. This can enable developers to know where their application is being used, and provide convenience functionality such as automatically completing a form based on the location of the user.
The SocketTools.HttpClient class provides an interface for accessing documents and other resources on a server using the Hypertext Transfer Protocol (HTTP). In some ways it is similar to the File Transfer Protocol (FTP) in that it can be used to upload and download files; however, the protocol has expanded to also support remote file management, script execution and distributed authoring over the World Wide Web. The class implements version 0.9, 1.0 and 1.1 of the protocol, including features such as support for proxy servers, persistent connections, user-defined header fields and chunked data. Both standard and secure connections are supported using SSL and TLS (HTTPS).
The SocketTools.HttpServer class implements a multithreaded, event-driven HTTP server that can be embedded in your application. It can be used to provide your software with a web interface that is directly under the control of your software, without depending on a third-party installation of a web server such as IIS or Apache. You can use the class to enable users to manage the application remotely, perform administrative tasks or access data that is dynamically generated by the application. The class can be used in a standard desktop application or a Windows service, and is highly configurable. The server supports both standard and secure connections using SSL and TLS, along with features such as virtual folders, local user authentication and support for CGI programs and scripting languages like VBScript.
The SocketTools.IcmpClient class implements the Internet Control Message Protocol (ICMP) and can be used to check if a system is reachable or determine how packets of data are routed to that system. Users are most familiar with this protocol as it is implemented in the ping and tracert command line utilities. The ping command is used to check if a system is reachable and the amount of time that it takes for a packet of data to make a round trip from the local system, to the remote host and then back again. The tracert command is used to trace the route that a packet of data takes from the local system to the remote host, and can be used to identify potential problems with overall throughput and latency. The class can be used to build in this type of functionality in your own applications, giving you the ability to send and receive ICMP echo datagrams in order to perform your own analysis.
The SocketTools.ImapClient class is used to access a user’s e-mail messages which are stored on a mail server using the Internet Message Access Protocol (IMAP). Unlike the Post Office Protocol (POP3) where messages are downloaded and processed on the local system, the messages on an IMAP server are retained on the server and processed remotely. This is ideal for users who need access to a centralized store of messages or have limited bandwidth. For example, traveling salesmen who have notebook computers or mobile users on a wireless network would be ideal candidates for using IMAP. The class provides methods to retrieve messages, or just certain parts of a message, create and manage mailboxes, and search for specific messages based on certain criteria. The class supports both standard and secure connections using SSL and TLS.
The SocketTools.InternetDialer class enables an application to connect to an Internet Service Provider (ISP) or a Virtual Private Network (VPN). Using this class, an application can discover what devices and remote networks are available, and manage those connections. Existing connections can be monitored, new connections created and a single class can be used to manage multiple connections. This class provides your application with complete control over the process of connecting to a service provider or VPN, monitoring that connection and then terminating that connection if needed.
The SocketTools.InternetServer class provides a general purpose, multithreaded server framework that can be used to create a custom server application. The server can accept multiple simultaneous client connections, and can be used with a typical desktop application or as part of a Windows service. The class interface is event driven, where your program simply implements its own event handlers to process the data sent by clients and respond to them. All of the client sessions are managed by the class, and it will not interfere with the main (UI) thread of the application which can perform its own tasks while the server is operating in the background. The class supports IPv4 and IPv6 network connections, and it can be configured to use either standard or secure connections using the SSL and TLS protocols.
The SocketTools.MailMessage class provides an interface for composing and processing e-mail messages and newsgroup articles which are structured according to the Multipurpose Internet Mail Extensions (MIME) standard. Using this class, an application can easily create complex messages which include multiple alternative content types, such as plain text and styled HTML text, file attachments and customized headers. It is not required that the developer understand the complex MIME standard; a single method call can be used to create a multipart message, complete with a styled HTML text body and support for international character sets. The Mail Message class can be easily integrated with the other mail related protocol classes, making it extremely easy to create and process MIME formatted messages.
The SocketTools.NntpClient class is used to access servers that provide news services using the Network News Transfer Protocol (NNTP). This is similar in functionality to bulletin boards or message boards, where topics are organized hierarchically into groups, called newsgroups. Users can browse and search for messages, called news articles, which have been posted by other users. On many servers, they can also post their own articles which can be read by others. The largest collection of public newsgroups available is called USENET, a world-wide distributed discussion system. The class provides a comprehensive interface for accessing newsgroups, retrieving articles and posting new articles. In combination with the SocketTools.MailMessage class to process the news articles, it can be used to integrate newsgroup access with an existing e-mail application, or you can implement your own full-featured newsgroup client. The class supports both standard and secure connections using SSL and TLS.
The SocketTools.PopClient class provides access to a user’s new e-mail messages on a mail server using the Post Office Protocol v3 (POP3). Methods are provided for listing available messages and then retrieving those messages, storing them either in files or in memory. Once a user’s messages have been downloaded to the local system, they are typically removed from the server. This is the most common e-mail protocol used by Internet Service Providers and the class provides a complete interface for managing a user’s mailbox. It is typically used in conjunction with the SocketTools.MailMessage class, which can be used to process the messages that are retrieved from the server. The class supports both standard and secure connections using SSL and TLS.
The SocketTools.SmtpClient class enables applications to deliver e-mail messages to one or more recipients using the Simple Mail Transfer Protocol (SMTP). The class provides an interface for addressing and delivering messages, and extended features such as user authentication and delivery status notification. Messages can be delivered directly to the recipient, or they can be routed through a relay server, such as a service provider's mail system. In combination with the SocketTools.MailMessageclass, it provides an extremely simple, yet flexible interface for composing and delivering mail messages. This class supports both standard and secure connections using SSL and TLS.
The SocketTools.SocketWrench class provides a higher-level interface to the native sockets class, enabling developers to easily incorporate Internet functionality in their applications. It supports both the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), can be used to create both client and server applications, and provides support for secure connections using SSL and TLS. With SocketWrench you can implement your own custom protocols and easily connect to other services.
The SocketTools.SshClient class enables an application to establish a secure connection to a server using the Secure Shell (SSH) protocol and either execute commands or begin an interactive terminal session. SSH is commonly used for remote logins where users interact with the server using a command-line interface, or to access a control interface for devices such as routers. It can also be used to execute commands remotely, returning the output back to the application. The class supports both the SSH-1 and SSH-2 protocols, and can be used in conjunction with the SocketTools.Terminal component, which provides ANSI and DEC VT terminal emulation for interactive sessions.
The SocketTools.Terminal component provides a comprehensive interface for emulating an ANSI or DEC-VT100/220/320 character terminal, with full support for all standard escape and control sequences, color mapping and other advanced features. The class methods provide both a high level interface for parsing escape sequences and updating a display, as well as lower level primitives for directly managing the virtual display, such as controlling the individual display cells, moving the cursor position and specifying display attributes. Typically, this component is used in conjunction with the SocketTools.SshClient or SocketTools.TelnetClient classes to provide terminal emulation services for an application.
The SocketTools.WhoisClient class provides an interface for requesting information about an Internet domain name using the WHOIS protocol. When a domain name is registered, the organization that registers the domain must provide certain contact information along with technical information such as the primary name servers for that domain. This class can be used to request that information and return it to the application so that it can be displayed or processed