Solved

Grab Client Information when OnConnect occurs (TServerSocket)

Posted on 2001-08-01
6
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 150 total points
ID: 6339810
Hi, try this instead

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

Author Comment

by:eddie_kho
ID: 6339842
i'll try it later...
thank u
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6341222
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:eddie_kho
ID: 6343099
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
ID: 6343125
Eddie, if it works, and it works correctly, why a C grade? :(
0
 

Author Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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