Different client connect server but get same IP??

i am doing a server for multiplayer game. when the client connect to server, server need to keep it IP. but why my server always get same IP for every connected client? my code is as below
public class CommServer {
    private Vector clients = new Vector();  // a list of all connected clients
    ServerSocket server;   // the server
    private static int INTPORT=9999;
public static void main(String args[]) {
        CommServer myCS = new CommServer(INTPORT);
   public CommServer(int port) {
        startServer(port);
   private void startServer(int port) {       
        try {
            // --- create a new server
            server = new ServerSocket(port);
             // --- while the server is active...     
            while(true) {
                // --- listen for new client connections
                Socket socket = server.accept();
                CSClient client = new CSClient(this, socket);
                writeActivity(client.getIP() + " connected to the server.");
                // --- start the client thread
                client.start();
        } catch(IOException ioe) {
            writeActivity("Server Error...Stopping Server");
            // kill this server
            killServer();
public class CSClient extends Thread {
    private Thread thrThis;         // client thread
    private Socket socket;          // socket for connection
    private CommServer server;
   protected BufferedReader in;    // captures incoming messages
    protected PrintWriter out;      // sends outgoing messages
public CSClient(CommServer server, Socket socket) {
        this.server = server;
        this.socket = socket;
        this.ip = socket.getInetAddress().getHostAddress();
        // --- initialize the reader and writer
        try {
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            out = new PrintWriter(socket.getOutputStream(), true);
        } catch(IOException ioe) {
                      killClient();
public String getIP() {
        return ip;
    }please help.. thanks

hi, thanks for reply.
yes, i am trying to connect from different macnine
that have different IP address.
how to check if it asign same external IP toclient?
can it be configure to assign different IP?what he means is, if you run your server at location
A, and all your clients from location B, with the
internet in between, and a single router/switch
serving internet connections to the clients at the B
location, then the server at the A location will see
the external IP of the site B router, not the
individual IPs of the clients behind the router
(since those IPs are only for internal network usage
behind the router)
in short, do you test with multiple clients from one
internet connection? then it would be logical that
they present the same IP to the server. The best (and
most realistic) way to test would be with multiple
clients from multiple locations / internet connectionsok.thanks.
so is it possible for me to get the client machine ip but not the IP for the router? because i will hav multiple user from same location access the server at the same time.

Similar Messages

  • Firefox not loading webpages from yesterday. I am getting a string of error and warning messages. I tried reloading but getting same messages. Like Parsing Value, Unknown property zoom. Lots of different errors. Cannot re-load pluggins. Help!

    Used Firefox for some time no problem until yesterday. Now it wont load web pages. Getting a string of warnings and errors. Tried reloading but getting same errors. Can't download pluggins. Error in Parsing, Unknown Property, Unknown Zoom, loads of messages like this for no apparent reason. Help please!
    == 10 July 2010

    Same thing started after updating to 3.6.6 on Window XP. Some pages load after doing "shift - Reload page", but not always. Error Console is showing a lot of "Errors" and lots of "Warnings" from pages that do not load. But before 3.6.6 update the pages loaded OK.

  • Strange problem with SQLPLUS when client and server on the same box

    Hi,
    I have the problem with SQLPLUS when clinet and server on the same machine.
    With client and server on the same machine i am running the command
    sqlplus -l username/password@connect_identifier as SYSDBA.
    With this command, even if you pass in wrong username or wrong password or both as wrong you can able to connect to database and execute queries.
    Once Connect_identifier is correct and trying to log in as SYSDBA ,sqlplus will log in to DB with any username and password.
    How to get rid of this behaviour. Is there any way to do this.
    I am running this command by creating a process in C#
    Edited by: user11000236 on Jun 16, 2009 10:31 AM

    user11000236 wrote:
    Thanks for the info.
    How does Oracle/SQLPLUS allows any username or password to log in to DB with SYSDBA Privillages? What is the concept behind this.?
    This is explainted in the above mentioned link:
    Operating system authentication takes precedence over password file authentication. If you meet the requirements for operating system authentication, then even if you use a password file, you will be authenticated by operating system authentication.

  • When I try to open a download PDF I get message to install Adobe Reader. I do it and get the same message already installed. I close Safari and reopen but get same message to install Adobe

    When I try to open a download PDF I get message to install Adobe Reader. I do it and get the same message already installed. I close Safari and reopen but get same message to install Adobe

    You don't provide any details, but from the sound of it you are trying to open an online PDF in a browser that does not use the Adobe Reader plugin: http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • Every time I open photoshop elements 11, it uninstalls. I have tried reinstalling 3 times, but get same result

    Every time I open photoshop elements 11, it uninstalls. I have tried reinstalling 3 times, but get same result.
    Can anyone help with this issue? Please!

    Hi 49balf,
    Thanks for visiting Apple Support Communities.
    I recommend removing and reinstalling iTunes using these steps:
    Check for .dll files
    Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files.
    If you find QTMovie.DLL, or any other .dll files, move them to the desktop.
    Reboot your computer.
    Note: Depending on your operating system, you may only have one of the listed paths.
    Uninstall and reinstall iTunes
    Uninstall iTunes and all of its related components.
    Reboot your computer. If you can't uninstall a piece of Apple software, try using the Microsoft Program Install and Uninstall Utility.
    Re-download and reinstall iTunes 11.1.4.
    You can find the article with these steps and more information here:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Best,
    Jeremy

  • How to show a picture both on client and server at the same time (X11?)

    Hi Guys
    I want show a picture on my client as well as on the server(in another location) at the same time, pretty much like showing something both on laptop and on a projector. Assume I have a picture sssss.jpg on the server A1, if I want to open that picture to my client, I can simply to do the following from client A2:
    xhost A1
    telnet to and login A1
    setenv DISPLAY "ipaddress of A2":0.0
    Anyone can direct me how to show picture the client that I am sitting at an also show on the server at the same time?
    Thanks

    VNC would let you do that. With a shared connection, both machines could run a VNC client to the same session.
    Darren

  • Connecting client and server on a same PC

    Hi,
    I installed oracle personnal DB 10g on my computer then I installed the client 10g on the same computer,
    I would like to know how to configure the files ("HOSTS",...) so I can enter on the client and work on the database. (It well help me simulate the work before having a real server)
    I already create a database on the oracle personnal named"ONDA" but I don't know what ip adress use and what to do.
    I tried some tutorials but doesn't work

    919563 wrote:
    Iam using Oracle 10g client and Oracle 10g R2 on the same computer (windows xp)Separate installations? Not needed, as the db installation includes a full client.
    Can you show where I had to write this "$ lsnrctl stat"
    and where I had to write this "$ sqlplus user@'hostname:port/servicename'" ?at the command prompt. (the '$' is just shorthand for the command prompt itself. at the prompt, you enter 'lsnrctl status'.)
    Whats is my servicename ?ONDA
    Can you give me please a quick tutorial ?
    http://edstevensdba.wordpress.com/presentations/
    I put the adress 127.0.0.1 for both server and client on the file "HOSTS"
    I wroteon HOSTS:
    127.0.0.1 server
    127.0.0.1 client
    should just have
    127.0.0.1    localhost
    xxx.xxx.xxx.xxxx   somehostnamewhere 'xxx.xxx.xxx.xxx' is a fixed ip (servers -- and your database is a server process) need fixed ip addresses
    where 'somehostname' is whatever name you want to use to refer to your computer.
    then I went to \network\admin\tnsnames.ora and I wrote:
    ONDA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 2080)(PORT = 1521))where did you come up with that value for HOST= ?
    (CONNECT_DATA =
    (SERVICE_NAME = ONDA)
    My database (on sever ) is named ONDA
    I don't know what to do on the listner? wich listner modify (server or client) ?There is no such thing as a 'client listener'. The listener is, by definition, a server-side process.
    DId you read -- and heed -- the installation instructions, especially those concerning installing a loopback adapter and a fixed ip address?
    Edited by: EdStevens on Mar 8, 2012 2:28 PM

  • Trying to make an image of a Server but getting error message

    I'm trying to make a disk image (.dmg) of an XServe. I boot the XServe off of an external drive, fire up disk utility and choose File>New>Disk Image from <server volume>
    Then I choose where I want the .dmg file to be created. It doesn't matter where I try to put it (one of the additional two unused hard drives in Bay 2 or Bay 3, or on a network volume), I get an error message: "Unable to create <server volume> (Resource Busy)."
    What am I doing wrong? Or what do I not understand yet?
    Thanks.

    Hi.
    Tried another tactic. I booted up the XServe into Target Disk Mode on a MacBook Pro. Then fired up Disk Utility again and chose File>New>Disk Image from "server volume". It started, but erred out with the "Resource Busy" message. Then I tried the same thing but this time instead of "server volume", I chose File>New>Disk Image from "698.6 GB AAPL FireWire Target Media". It still erred out with the "Resource Busy" message. Then I tried File>New>Disk Image from Folder, and then chose "server volume", and then selected where to save the .dmg and it started to create the image, but erred out with "Unable to create "server volume" (No such file or directory)." Then I tried "Disk Image from Folder" again, but this time chose "698.6 GB AAPL FireWire Target Media", selected where to save the .dmg, and once again, it started to create the image, but erred out again with "Unable to create "server volume" . I'm at a loss. I am unable to create an image of the XServe HD and I need to. Does anyone out there have any ideas? Thanks.

  • When clients ping server, they get the wrong ip address.

    I have a server with the ip address of 10.0.1.10, but when clients ping the name "dyn01," they get 10.0.1.83.
    If they ping "dyn01.local" they get the correct ip address.
    I used server manager to look at DNS, and the ip address for the server is correct. I'm not sure what to try next.

    Client IP is logged in the access log, which is CLF by default.
    Do you need this info in the event log, as well?
    What do you need client IP info for?

  • AVCFPlayerAppliesMediaSelectionCriteriaAutomaticallyKey could not be located in the dynamic link library AVFoundationCF.dll.  I have deleted and rein-staled 5 times, but getting same message..........HELP!!!!!!!!!!!!!!!!!!!PLEASE!!!!!!!!!!!!!!!!!!!!!!!

    Hello,
             I dumped Itunes and QuikTime, tried to reload ( 4 Times) but keep getting the same error message.
                          ENTRY POINT NOT FOUND
          The procedure entry point
    AVCFPlayerAppliesMediaSelectionCriteriaAutomaticallyKey could not be located in the dynamic link library AVFoundationCF.dll.
                           HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!           PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi, Did you strip out all components, delete the named folders and reboot as in the second box of  Troubleshooting issues with iTunes for Windows updates?
    Checking on my computer here (Windows XP SP3 32 bit) I have one copy of iAdCore.dll in the main \Program Files\iTunes folder with the following properties:
    Size 3,004  KB
    Created 8th May 2014
    Modified 8th May 2014
    File Version 1.0.0.1
    Product Version 1.0.0.1
    I'll try to get a look at 64-bit system later to confirm the correct path.
    tt2

  • Bind Lion to snow lepard server but get network profiles

    we have a open directory that is currenty running on a mac osx snow lepard server. we have binded some lion macbook pros but when we log off it does not display the list of users on the network it just shows the local accounts and other. If we go in though other we can log into the netowrk profile but we would prefer to get a list instead of manual typing it in all the time. we have checked that the list of names is checked in the users and groups. any advice?? can it be done??

    Have you had any luck finding a solution to this?  The only thing I have found was to unbind and then bind without authentication.  Any help with progress on your end would be appreciated!
    Nick.

  • I am trying to install the newest version of Itunes and it fails with the message "Program cannot start MSVCR80.dll is missing from your computer. Try reinstalling program to fix this program.I have tried reinstalling several times but get same results

    I am trying to install the newest version of Itunes and each time I repeatedly get the message "Program cannot start MSVCR80.dll is missing from your computer Try reinstalling to fix this problem". I have tried reinstalling several times and I get the same message . Any ideas? I am most appreciative. I am using Windows 7.

    Hi 49balf,
    Thanks for visiting Apple Support Communities.
    I recommend removing and reinstalling iTunes using these steps:
    Check for .dll files
    Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files.
    If you find QTMovie.DLL, or any other .dll files, move them to the desktop.
    Reboot your computer.
    Note: Depending on your operating system, you may only have one of the listed paths.
    Uninstall and reinstall iTunes
    Uninstall iTunes and all of its related components.
    Reboot your computer. If you can't uninstall a piece of Apple software, try using the Microsoft Program Install and Uninstall Utility.
    Re-download and reinstall iTunes 11.1.4.
    You can find the article with these steps and more information here:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Best,
    Jeremy

  • Not 'Getting started with SQL server' but 'Getting SQL server started'

    As a developer, I hate it when I lose valuable time because Windows 'is not working' and thus I can not work.
    I don't know what would be the best forum to post this, please let me know if there is a better one.
    Today after, a Windows Update and a reboot SQL server won't start anymore.
    The error in the event log:
    The SQL Server (MSSQLSERVER) service terminated with the following service-specific error:
    An attempt was made to access a socket in a way forbidden by its access permissions.
    I stopped the firewall, but the problem remains.
    As it is apparently not the firewall I have no idea how to resolve this problem, any suggestions welcome.
    Thanks :(
    And these are the updates that were installed:
    Installation Successful: Windows successfully installed the following update: Definition Update for Windows Defender - KB2267602 (Definition 1.193.2423.0)
    Installation Started: Windows has started installing the following update: Definition Update for Windows Defender - KB2267602 (Definition 1.193.2423.0)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3033889)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3035527)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3036612)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3039066)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3018133)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3035132)
    Installation Successful: Windows successfully installed the following update: Cumulative Security Update for Internet Explorer 11 for Windows 8.1 for x64-based Systems (KB3032359)
    Installation Successful: Windows successfully installed the following update: Security Update for Internet Explorer Flash Player for Windows 8.1 for x64-based Systems (KB3044132)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3024751)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3035017)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3030377)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3035131)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3035553)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3013172)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3027209)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3030947)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3036228)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3029606)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3034348)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3029803)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3032323)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3022796)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3012235)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3034344)
    Installation Successful: Windows successfully installed the following update: Security Update for Windows 8.1 for x64-based Systems (KB3046049)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3012702)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3036562)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3025417)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3024755)
    Installation Successful: Windows successfully installed the following update: Update for Windows 8.1 for x64-based Systems (KB3000850)

    Refer the below similar link
    https://social.technet.microsoft.com/Forums/windows/en-US/e0cc1b3e-2c63-451a-abc8-8e1e66a23287/an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissions?forum=w7itpronetworking
    --Prashanth

  • Move SSRS engine to new server, but keep same reporting databases

    We have our SQL Server reporting services (2008 R2) setup as follows:
    ServerA: contains the reporting services engine (including the report manager URL, web service URL and so on).
    ServerB: Is the sql server instance that hosts the reporting databases for ServerA (ReportServer and ReportServerTempDB).
    ServerA is EOL and will be replaced by ServerC. I have two questions:
    1. How do we proceed to install Reporting Services on ServerC so that it points to the databases on ServerB.
    2. How do we migrate the reports (and settings) from ServerA to ServerC.  Will this be automatic by pointing ServerC to the exiting databases on ServerB.
    Thanks.

    Hello,
    All reports / Settings are stored in ReportServer database, so if you Keep your database you have nothing to migrate.
    Install SSRS without configuration on the new machine and afterwards do the configurtaion with Point the "ReportServer" database to ServerB.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • 2 iphones, 2 apple IDs, but getting same messages

    so my father and i set up our phones under my apple account, then once he got one we took my account off under the icloud settings.., we just did the software update latest on his phone and he is getting all of my messages on his phone for some reason
    any ideas how to stop this?

    Settings > Messages, log off the Apple IDs on both of your iPhones.  Once done, login your own Apple IDs on your own iPhones.

Maybe you are looking for

  • How to change the size of Bex Variable screen?.

    Hi Experts, Can we able to change the size/font of the Bex query variable screen?. I have a requirement where lot of variables used but query variable screen is not showing up all the variables including the 'execute,cancel, check' menu buttons. Is t

  • Upload Vendor master data using LSMW

    Hi All,       i am working on LSMW for uploading the Vendor master data (XK01), when i execute the 13 th step (Create batch input session), i got a message like "Editing was terminated" . Could you please tell me why that message is comming. Regards,

  • Pricing Types in Copy Control

    Hi Xperts, Can any of you guide me the exact difference between the pricing type D: Copy pricing elements unchanged and E: Copy Pricing Elements and values unchanged which is maintained in the copy controls. Thanks Smita

  • Why can't Ifind my DataSource through a cluster?

    Hello! I use Weblogic 8.1.6. I have set up 1 adminserver at 127.0.0.1:7001. I have set up 1 managedserver at 127.0.0.1:7011. I have set up 1 managedserver at 127.0.0.1:7021. I have set up a "Data Source". This data source is target on all servers. Th

  • Long term planning in ECC for materials planned in SAP APO

    Hi SAP PP and APO Experts, I would like to know whether it is possible to plan a material in SAP ECC with Long Term Planning to create Simulative Planned Orders in ECC, when the MRP Type for the material is set to X0 (Planning in SAP APO). Warm regar