IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Mike Stefanik on May 02, 2006, 01:05:42 PM

Title: SocketTools Beta Release 3
Post by: Mike Stefanik on May 02, 2006, 01:05:42 PM
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:


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.
Title: Re: SocketTools Beta Release 3
Post by: Mike Stefanik on May 02, 2006, 01:39:05 PM
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.
Title: Re: SocketTools Beta Release 3
Post by: Zen on May 02, 2006, 01:44:38 PM
Hmmm i guess this sort of puts my attempts at making a set of internet classes to shame really.

Lewis
Title: Re: SocketTools Beta Release 3
Post by: Shannara on May 02, 2006, 02:49:25 PM
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 :)
Title: Re: SocketTools Beta Release 3
Post by: Mike Stefanik on May 02, 2006, 04:28:29 PM
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.
Title: Re: SocketTools Beta Release 3
Post by: Shannara on May 02, 2006, 05:09:24 PM
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 :(
Title: Re: SocketTools Beta Release 3
Post by: Mike Stefanik on May 02, 2006, 05:37:28 PM
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).
Title: Re: SocketTools Beta Release 3
Post by: Rock Ridge Farm (Larry) on May 02, 2006, 06:06:35 PM
Sooooo - what would be the price for us Aurora groupies?
Title: Re: SocketTools Beta Release 3
Post by: Shannara on May 02, 2006, 07:12:29 PM
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!
Title: Re: SocketTools Beta Release 3
Post by: Mike Stefanik on May 02, 2006, 10:22:43 PM
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.
Title: Re: SocketTools Beta Release 3
Post by: Steven Picard on May 03, 2006, 08:56:31 AM
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)
Title: Re: SocketTools Beta Release 3
Post by: Mike Stefanik on May 09, 2006, 11:56:18 PM
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.