I've just uploaded SocketTools 4.5 Beta Release 3 (4.50.1095), which is now code-complete. This beta is set to expire at the end of the year (31 Dec 2006) so you'll have a lot of time to work with it as Aurora is being improved, etc. There's no charge for the class library itself, but of course it does require that you have a license for Aurora. You can download the current build using the following link:
ftp://ftp.catalyst.com/pub/cstools/beta/cstacl45.exe
SocketTools is a collection of TCP/IP networking and general utility classes that are designed to make integrating Internet functionality in your programs extremely simple. The classes that are included are:
- CCompression - Implements compression related functions using either the Deflate or Burrows-Wheeler compression algorithms.
- CDnsClient - Implements the Domain Name Service (DNS) protocol which enables an application to resolve a host name into an IP address, as well as perform other types of queries.
- CEncoder - Implements encoding and decoding functions which can be used to convert between binary and text data. Includes support for base64, uuccode, yenc and quoted-printable encoding.
- CFtpClient - Implements the File Transfer Protocol (FTP) which enables an application to upload and download files and perform remote file management functions such as listing available files, renaming files, creating directories and removing files and subdirectories. Supports secure file transfers using the standard SSL/TLS protocols.
- CHttpClient - Implements the Hypertext Transfer Protocol (HTTP) which enables an application to upload and download files, execute scripts on a web server, post form data to hosted applications and perform a variety of document management functions if the server supports WebDAV. Supports secure connections using the standard SSL/TLS protocols.
- CIcmpClient - Implements the Internet Control Message Protocol (ICMP) which is commonly used to determine if a remote host is reachable, and the latency between the local and remote host. It is the protocol used by the ping and tracert commands under Windows.
- CImapClient - Implements the Internet Message Access Protocol v4 (IMAP) which enables an application to check a mail server forÂÃ, new e-mail messages and allows the user to manage their mail folders remotely. Supports secure connections using the standard SSL/TLS protocols.
- CMailMessage - Provides support for creating and parsing RFC822 and MIME formatted e-mail messages. This class is typically used in conjunction with the CSmtpClient, CPopClient and CImapClient classes.
- CNetworkTime - Enables an application to retrieve the current time from a network time server and synchronize the system clock.
- CNntpClient - Implements the Network News Transfer Protocol (NNTP) which enables an application to read and post articles to a news server. Supports secure connections using the standard SSL/TLS protocols.
- CPopClient - Implements the Post Office Protocol v3 (POP3) which enables an application to check a mail server for new e-mail messages and download those messages to the local system. Supports secure connections using the standard SSL/TLS protocols.
- CRshClient - Provides the ability to execute commands on a remote server using either the rsh or rexec protocol. Also includes support for rlogin, which is similar to the standard TELNET protocol. This class is commonly used in conjunction with the CTerminal class.
- CSmtpClient - Implements the Simple Mail Transfer Protocol (SMTP) and Extended Simple Mail Transfer Protocol (ESMTP) which is used to submit e-mail messages to a mail server for delivery. Supports authentication, delivery status notification and secure connections using the standard SSL/TLS protocols.
- CSocketWrench - Implements a general purposes TCP/IP class which can be used to create virtually any kind of custom network application. Includes support for both the TCP and UDP protocols, synchronous and asynchronous operation and can be used to create both client and server applications. Supports secure connections using the standard SSL/TLS protocols.
- CTelnetClient - Implements the TELNET protocol which is used to establish an interactive, character-based terminal session with a remote host. This class is commonly used in conjunction with the CTerminal class. Supports secure connections using the standard SSL/TLS protocols.
- CTerminal - Implements a virtual display which emulates an ANSI or DEC VT character terminal. This class is derived from the CWindow class, and may be used as a standard overlapped window or a child window in a dialog.
The package also includes documentation and examples. Please note that the documentation is not complete, and the actual interface for a given class may be different than what is specified by the documentation. When in doubt, always refer to the include file cstacl45.inc. If you have any questions, problems or just general feedback, please feel free to post them here, I monitor these forums regularly.
In case you're wondering what the class interfaces are generally like, here's a basic example of what's involved in returning a list of files on an FTP server:
#autodefine "off"
#include "cstacl45.inc"
sub ListFiles()
{
ÂÃ, Ã‚Ã, CFtpClient ftpClient;
ÂÃ, Ã‚Ã, // Connect to the public FTP server at ftp.ietf.org, the organization
ÂÃ, Ã‚Ã, // that maintains standards documents for Internet protocols
ÂÃ, Ã‚Ã, if (ftpClient.Connect("ftp.ietf.org"))
ÂÃ, Ã‚Ã, {
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // Login to the server. If no arguments are specified, then an
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // anonymous login is performed.
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, if (!ftpClient.Login())
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, {
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, print("Unable to login as anonymous user");
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, ftpClient.Disconnect();
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, return;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // Open the /rfc directory where the various standard documents
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // are stored
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, if (!ftpClient.OpenDirectory("/rfc"))
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, {
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, print("Unable to open the specified directory");
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, ftpClient.Disconnect();
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, return;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã,Â
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // Begin listing the available files
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, FTPFILESTATUS file;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, int nCount = 0;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, int bResult;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, bResult = ftpClient.GetFirstFile(&file);
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, while (bResult)
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, {
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, // If the file is not a directory, then display its name and size.
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, // Other information is also available such as its modification
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, // date, owner and access rights
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, if (!file.bIsDirectory)
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, {
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, print("File: ", file.strFileName, " Size: ", file.dwFileSize);
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, nCount++;
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, bResult = ftpClient.GetNextFile(&file);
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, // Close the directory and disconnect from the server
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, ftpClient.CloseDirectory();
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, ftpClient.Disconnect();
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, print("\nA total of ", nCount, " files were listed");
ÂÃ, Ã‚Ã, }
ÂÃ, Ã‚Ã, return;
}
global sub main()
{
ÂÃ, Ã‚Ã, ListFiles();
ÂÃ, Ã‚Ã, print("Press any key to end this program ...",);
ÂÃ, Ã‚Ã, while (GetKey() = "");
ÂÃ, Ã‚Ã, return;
}
In most cases it's all pretty straight-forward, with reasonable defaults for those options that are omitted. For more complex implementations, check out the example projects that are included.
Hmmm i guess this sort of puts my attempts at making a set of internet classes to shame really.
Lewis
Giving the current price for socket tools found @ http://www.catalyst.com/order/pricing.html I say Lewis ... you definately have some damand for your classes :)
A while back I had posted that when they are released as a commercial product, any pricing would be in line with the compiler. We've done similar things for other languages such as PowerBASIC and IBasic in the past. For now, the classes are free to use and will continue to be as long as Aurora itself is in the alpha and beta stages of development.
Of course, if you want to implement your own Internet classes, give it a whirl. I can guarantee it'll certainly be an education, if nothing less (just implementing SSL/TLS using the CryptoAPI is an adventure unto itself, given how poorly its documented). In the end, the reality is you get what you pay for. There's a lot of free classes out there for languages like C++ too, and yet people still buy ours. Primarily because they want support, and they want something that fully supports the RFC standards.
Most of the freeware libraries that I've seen out there basically implement just enough of the protocol to get by, and don't implement some things correctly at all because they don't fully understand the specification -- the end result is a program that works 90% of the time and dies spectacularly the other 10%. When your customer is a Motorola, Sony or Northrop, that kind of failure rate is something that you can't afford.
This version of SocketTools is something I've done out of my own interest in Aurora and a way to contribute something as a third-party to the language. It's not my "day job" (that's programming in C# and C++ mostly) and so this is basically an unofficial personal project that I have approval to work on. If, when and how it becomes a commercial product also largely depends on Aurora itself.
My apologies if i offended you. I really did not mean to offend. I looked at SocketTools for use with VB6 quite a few years ago (over 3, I believe). Simply, because I needed IOCP and ability to bind to a specific IP and port. The $200 price tag at the time put me off as it was for a freeware product. Since then, yes, I can afford $200 nowdays ;) I must of missed the price in line with the compiler part. But then again, I havent been around these boards for awhile ... Thats an impressive consumer list :)
Any chance do you have a purebasic version handy? The current (4 beta 11) network library is incomplete at best :(
No offense taken at all, just personal observation. I've had a lot of conversations with developers who tried rolling their own file transfer or email classes and realized how complex it gets when they get out there in the "real world" and their software has to work against a whole range of different kinds of servers (Windows, Novell, UNIX, VMS, etc.) I don't really knock the freeware stuff at all. Most of it generally works for very basic needs, and for the more complex tasks, it actually turns out to be a great selling point for our libraries. :)
As for PureBasic, I remember looking into the language a while back. You should be able to use our Libarary Edition DLLs with it without any problem. We use the standard (unmangled) naming convention and for the most part use intrinsic data types (or simple structures).
Sooooo - what would be the price for us Aurora groupies?
Thanks for the response, Mike. All I need is the client/server dlls, and it looks like SocketWrench 4.5 Standard is the way to go. And only for $95.00, whoo hoo!
Quote from: Rock Ridge Farm (Larry) on May 02, 2006, 06:06:35 PM
Sooooo - what would be the price for us Aurora groupies?
For now, free. Down the road, I can't really say but I'd push for it be in line with the final cost of the compiler. And if "early adopters" were to contribute example code and promote it, I'm sure I could swing a few free licenses. I may even see if there's something that could be worked out with Paul in bundling SocketTools with Aurora.
Quote from: Mike Stefanik on May 02, 2006, 10:22:43 PMI may even see if there's something that could be worked out with Paul in bundling SocketTools with Aurora.
Oh, that would be good! 8)
I've updated the build for the new release of the compiler (Alpha 3 Rev 1). You can download it from the same location:
ftp://ftp.catalyst.com/pub/cstools/beta/cstacl45.exe
This update also has some minor internal bugfixes, but no changes to the class interface or how it operates.