Home arrow Delphi-Kylix arrow Page 2 - Building an Internet Access Control Application
DELPHI-KYLIX

Building an Internet Access Control Application


If you’ve ever visited an Internet café, you've noticed that there is usually a timer on the screen that tells you how much time you have left to use the Internet. In this series of articles we will discuss both the underlying architecture of such an application as well as the code involved, culminating in creating an example application.

Author Info:
By: David Web
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
August 18, 2008
TABLE OF CONTENTS:
  1. · Building an Internet Access Control Application
  2. · The Protocol
  3. · The Server Application
  4. · Client Application

print this article
SEARCH DEVARTICLES

Building an Internet Access Control Application - The Protocol
(Page 2 of 4 )

The indy components that we will be using make it easy to create a custom protocol. We will be using two components, called idCmdTCPClient and idCMdTCPServer, that provide the medium for us to create our own communication protocol. Because we’ve looked at the requirements for the applications involved, we already have an idea of how the communication should go.

First, the Client Application contacts the server application and connects, giving its name. For example, if the client computer is called Joe Blogg, then it will try to give that name to the server application. At this point the server should actually check to see if the name already exists and then send an appropriate error message back. This is of course dependent on whether you are actually going to use this application for the purpose that it is designed (to control access to the Internet), in which case all the computers that are connected to the network will already have unique names. Also with the name is included another piece of status information, which tells the server that the connecting client is available. So the total sum of the communication sent by the client should be something like this:

computername status:free

The second step involves the Server. Since the communication from the client will be two parts (name and status), the server takes that communication and breaks it up into the individual two parts. At the same time the server takes the IP address of the connecting client as well as the time of connecting. So something like this takes place on the server:

server: name OK

status OK

 

If not OK then

send appropriate message to client and disconnect


Finally, once the connection is successful then all communication from here on in will be initiated by the server application. For example, to tell a client to grant access for ten minutes, the server would send the following communication:


activate:workstation@10


The above statement says: activate the computer that has the name "workstation" for ten minutes. The client application receives this string, breaks it up into three pieces, and gives it to the relevant functions for further processing.


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials