Solved

Grab Client Information when OnConnect occurs (TServerSocket)

Posted on 2001-08-01
6
222 Views
Last Modified: 2010-04-06
OVERVIEW:
The application was designed in three moduls, they are:
1. Server (TServerSocket)
   Will receive any message from Controller, and send it
   to specified Terminal.
2. Client/Terminal (TClientSocket)
   Will only act as a message receiver.
3. Controller (TClientSocket)
   Specify the destination (Terminal) and send message to
   Server.

When the Controller connected to Server, it will receive
a LIST of active-connections (connected terminal) and
updated by Server everytime there were new connection or
disconnection. The Controller will using this LIST to
specify which Terminal will receive its message.

QUESTION:
The LIST will contain information of each active Terminal,
I want it contains the Terminal's IPAddress, HostName, ConnectionNumber, etc... I think Server would get this
info on the ClientConnect event, but how?

I have tried this, but it just contained null string.

procedure TfrmServer.sskServerClientConnect(Sender:
  TObject; Socket: TCustomWinSocket);
begin
   aClient.sIP := TClientSocket(Sender).Address;
   aClient.sName := TClientSocket(Sender).Host;
......
......

Help me please....
0
Comment
Question by:eddie_kho
  • 3
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 150 total points
Comment Utility
Hi, try this instead

aClient.sIP := Socket.RemoteAddress;
aClient.sName := Socket.RemoteHost;
0
 

Author Comment

by:eddie_kho
Comment Utility
i'll try it later...
thank u
0
 
LVL 1

Expert Comment

by:h_mohsenian
Comment Utility
hi eddie_kho,

sorry for unrelated question!

are you a control ( Automation ) Eng. I am a senior Student of  Electrical Control Eng. and I do one cource project ( for Automation Cource ) a bit like your App that tiltle was : ' simulate DCS Automation System on Electrical Department LAN.

best regards
hamed
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:eddie_kho
Comment Utility
dragonslayer:
haaha...
i thought it won't be that ez...
but its really work, thank u dragonslayer

h_mohsenian:
i'm not a control eng as u thought, just a software eng (programmer analyst)... if u want to share info about your project, my addr: ad@binus.ac.id
0
 
LVL 14

Expert Comment

by:DragonSlayer
Comment Utility
Eddie, if it works, and it works correctly, why a C grade? :(
0
 

Author Comment

by:eddie_kho
Comment Utility
sorry... but i thought it was too easy... :p
sorry for disappointed you
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now