Delphi-Kylix
  Home arrow Delphi-Kylix arrow 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


    (Page 1 of 5 )

    In the preceding article we started to explore the code that makes up the server communication. If you haven’t read that article, please make sure to do so, because almost everything that I will be discussing in this article will directly reference code that we discussed there. A lot of the things that we will be discussing here will make sense once you have read the previous article.

    The three procedures

    There are three more procedures that we must look at before we conclude the server portion of this article, because they are also essential to the overall functionality of the server program. The first of the three procedures deals with what happens when a workstation registers with the server at startup:

    procedure TForm1.tsConnect(AContext: TIdContext);

    var

    str,cmdrslt,cmd,placeholder:string;

    begin


    If you look back at the discussion that we had about the TIdContext class, and take a closer look at the constructor creation procedure, you will note that the properties and methods of the TidContext class were inherited by the TMyContext object. This means that we will be able to access all the properties of the context class through the TMyContext object by using the dot notation.

    For example, to access the compname property of the object, we simply type TMyContext(AContext).compname.In other words, every client or workstation that connects will be given its own context in which their communication with the server will take place. It is also at this point that the context class sets up the context list that is updated as workstations connect to the server:


    with TMyContext(AContext) do

    begin


    The function takes the current time:


    Con:=Now;


    Then it checks to see if the client is connected by examining the socket property of the connection:


    if (Connection.Socket <> nil) then


    If the socket indicates that there is a client connected, then the client IP address is taken: 

    IP :=Connection.Socket.Binding.PeerIP;


    More Delphi-Kylix Articles
    More By David Web


     

    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 3 Hosted by Hostway
    Stay green...Green IT