Finishing the Client for an Internet Access Control Application
Last week we began our discussion of the client side of an Internet access control program. This week we'll continue to cover the important parts of the code. We'll start with the reading thread, then go to the ini file. Keep reading to be enlightened.
Finishing the Client for an Internet Access Control Application (Page 1 of 4 )
The reading thread listens for any communication from the server. It will wait for commands from the server for as long as the client is connected and then pass any communication on to the synchronization functions for processing. Here is the code:
When the client is connected, the reading thread is activated and set up:
procedure TForm1.tcConnected(Sender: TObject);
begin
rt := TReadingThread.Create(tc);
end;
procedure TForm1.btnDisconClick(Sender: TObject);
begin
tc.Disconnect;
end;
One of the many actions that is carried out when the client connects is implemented here. First, the client sends over its name and IP address. The btnConnect procedure shows how it is done in code: