Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 5 - Important Procedures for an Internet Acces...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Important Procedures for an Internet Access Control Application
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-09-15

    Table of Contents:
  • Important Procedures for an Internet Access Control Application
  • Taking Names
  • Disconnecting from the Server
  • The tsExecute Procedure
  • Suggested Improvements

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Important Procedures for an Internet Access Control Application - Suggested Improvements


    (Page 5 of 5 )

    If you are going to use this application in an Internet café with a large number of workstations, say, 500 or more, I would suggest looking into optimizing the code with critical sections and other functions that deal with bottleneck situations. Also, if you are going to use the application in any other setting (other than an Internet cafe), I would suggest that you create a function to check that all connecting clients have a unique name before registering them. This will avoid confusion on the server's part when communicating with clients.

    A further improvement that you can make is to create a function to check whether or not a client is still connected, I’ve avoided this because I wanted to keep the communication between the client and the server to a minimum. Also, the server and client are set up in such a way that, if the client disconnects, the server will immediately detect and confirm it on the server interface. The kind of function I’m referring to is known as a "heartbeat" function or "keep-alives" by communication software developers. It includes placing a timer on the client application that sends a periodic message back to the server to indicate that it is still connected and alive. This is only necessary if you anticipate long hours of inactivity between the server and client. Also, for future changes in the communication format I’ve written a parse function that breaks communication down into four parts. It is based on the current parse() function:


    function parse4(s : string; var Token1,Token2,Token3,Token4: string) :

    boolean;

    var

    P1,P2,P3 : integer;

    begin

    P1 := Pos(':',s);

    P2 := Pos('@',s);

    P3 := Pos(';',s);

    //Test if both delimiters are present, in the right order and

    //at least 1 char apart

    if ((P1 > 0) and (P2 > 0) and (P3 > 0) and (P2 > P1) and (P3 > P2) and (Abs(P3-P2) > 1) and (Abs(P2-P1) > 1))

    then begin

    Token1 := Copy(s,1,P1-1);

    Token2 := Copy(s,P1+1,P2-P1-1);

    Token3 := Copy(s,P2+1,P3-P2-1);

    Token4 := Copy(s,P3+1,Length(s)-P3);

    Result := True; //valid string

    end

    else Result := False; //invalid string

    end;


    It is extremely easy to modify this function if you ever need to. What’s more, you do not have to worry about using common delimiters, because all communication takes place internally between the client and server; no user input is required at all in this case. You would have to worry about delimiters if you want to use the server application as a chat server; then of course you cannot use common delimiters, because users will use common delimiters like “@” if they are sending an email address to someone else on a chat. My current communication protocol would crash if that were to happen.

    Conclusion

    The next article in the series will deal with the last remaining section of the server application, which is user management. This module will enable the server administrator to add, remove or to view user information.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    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...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek