Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Grab Client Information when OnConnect occurs (TServerSocket)

Posted on 2001-08-01
6
Medium Priority
?
245 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 300 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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