get some info of client computer

Posted on 2006-05-16
Last Modified: 2010-04-05
Im using TIdTCPServer in server application and TIdTCPClient in client application to communicate via internet.
when client connected to server, I can get client remote IP only.

Can I get local ip or computer name of client from server ?
Question by:lhquang
    LVL 17

    Accepted Solution

    The only info you can get from teh client connection is the ip and port
    will give you the client's ip address
    will give you te port it is using

    But to get the computer name or it's local ip (in it's lan, instead of the router's ip) over the internet, the client will have to send it to you
    IdTCPClient1.IOHandler.WriteLN('hi, my pc name is "bob" and my lan ip is "x.x.x.x"');

    Author Comment

    because someone can make new client and send command to my server, someone can send bad lan ip,bad computer name too.

    my purpose : limit the connection ( from one computer to my server) to 1.

    if that computer run more than one client, only one client can connect, my server will disconnect other client.

    I cannot count base on internet IP address because if that computer belonged to LAN with many computers use one internet IP address.

    LVL 28

    Expert Comment

    this is an old issue and is generally found in "clone-detection" schematics. the best solution for this at this point is to have another system that creates users and in that system you can implement as many restrictions as you want (or can, considering the limitations of the tehnology used). then, that user will be used by the client upon connecting. it is not 100% efficient, maybe not even 90%, but it's one of the best ways to stop clone connections considering that you can't control the making of the client software.

    Author Comment

    I want to make out public chat without creating account, so there is no way to limit ? T_T
    LVL 28

    Expert Comment

    not unless you explicitly ask in the chat protocol that the client must send out some identification that must be computed from some system information like:
    - netcard MAC
    - maybe other irrelevant stuff
    you can verify at a rate of 80% that the received MAC is a valid network card MAC or a router MAC (there are, or at least were a few years back when I was searching for such stuff) public lists with manufacturer and their codes and product codes (you will have to decode the MAC for that))
    - if the client doesn't send out a valid MAC you just close the connection. if it's a router mac then somebody is trying to trick you (remember, the client sends out the AMC of it's own network card ;) )
    you might also ask for some info already found in the MAC address just to make sure that someone is not trying to trick you. but even so, the chanes are not higher than 98% in accuracy of clone detection.
    LVL 17

    Expert Comment

    I agree, I don't think it's possible to do what you want.
    You will have to rely on a "login" system, and/or a limit per user, rather than connection
    that way, if someone gets a user login, they can still only logon once, no matter how many machines they have.
    If however, you do want them to be able to log on with 2+ machines in their cyber cafe (for example) they would have to use a different login for each computer.

    Author Comment

    yes, some can make may accounts and login  many accounts.

    I just want to limit connection in one computer.

    and there is no way.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    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…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 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

    23 Experts available now in Live!

    Get 1:1 Help Now