Results 1 to 5 of 5
  1. #1
    ersachinjain is offline Member
    Join Date
    Aug 2009
    Posts
    51
    Rep Power
    0

    Default Socket Communication on different networks

    Hi

    I want to write an application where the server and the client are running on different network. It's not an applet but an application. The problem is that I want the server to run on a different network and the client to run on a different network something that happens with all the messengers. Can any one help me.

    Thanks

    Sachin

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    5

    Default

    The client tries to make a connection to an IP and port. It doesn't care if it's on the same network or out somewhere on the internet.

    The server listens for connections and communicates along a Port on the machine it is running on. It also doesn't care where it comes from.

    This all has to do with your network router settings. You will need to find a way to figure out your public ip address, is it static? or dynamic? or do you have a domain?, so that your client will know where to connect, also you will need to have your router port-forward the port you want to use to the machine that is running your server.
    Last edited by mrmatt1111; 09-03-2009 at 09:04 PM.
    My Hobby Project: LegacyClone

  3. #3
    ersachinjain is offline Member
    Join Date
    Aug 2009
    Posts
    51
    Rep Power
    0

    Default

    Thanks Matt

    So I guess then I have to configure my router????

  4. #4
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    5

    Default

    Indeed :)

    Port forwarding

    What is my IP

    And if you have a dynamic ip: Dynamic DNS
    My Hobby Project: LegacyClone

  5. #5
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Routers connect local networks, so that is the right approach. Is it your router, or does it belong to IT? Unless this is something at home, have the network admin do it.

Similar Threads

  1. Communication between two Jars
    By Gijava in forum Advanced Java
    Replies: 1
    Last Post: 06-26-2009, 04:59 PM
  2. append response to the request from Socket and write to another socket
    By vaibhav_singh_vs@yahoo.co in forum Networking
    Replies: 3
    Last Post: 04-17-2009, 07:02 PM
  3. communication between classes
    By willemjav in forum New To Java
    Replies: 10
    Last Post: 09-01-2008, 10:08 PM
  4. Jar and War communication in an Ear
    By madanmohanp in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2008, 01:39 PM
  5. Communication with c++
    By mathias in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •