Solved

Grab Client Information when OnConnect occurs (TServerSocket)

Posted on 2001-08-01
6
226 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
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

776 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