REALbasic Networking Classes


The class hierarchy provided by REALbasic falls neatly into this layered approach to thinking about networks, as illustrated in Figure 9.1:

Figure 9.1. Internet suite of protocols.


At the top of the hierarchy is the SocketCore class, which is an abstract class that is never instantiated. There are two subclasses to SocketCore: TCPSocket and UDPSocket. These are the two basic socket classes that you will be using to write your networked application. TCPSocket has several subclasses that work on the Application Layer, which means that they are designed to perform specific kinds of activities on the Internet, such as request web pages and send or receive email.

Although a lot can be done with these classes, I am going to focus primarily on the TCPSocket class for the rest of the chapter and use it to develop a web server. A web server uses HTTP, and there is an HTTPSocket class provided by REALbasic. This class, however, isn't designed to be a server. It's good only for making HTTP requests and receiving files, not sending them. The sample application will get into enough detail that you will be able to use the TCPSocket class effectively in a variety of situations.

REALbasic also provides a few classes that you can use to get information about the network environment your application is running in. I'll start the chapter with these classes and then move on to the sample application.




REALbasic Cross-Platform Application Development
REALbasic Cross-Platform Application Development
ISBN: 0672328135
EAN: 2147483647
Year: 2004
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net