Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

server socket ip address problem

  • 04-02-2012 04:49PM
    #1
    Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭


    Hi, I am running a serverSocket(port 4242) on an android phone(in java). a PC or another android device has the ip address of the server phone and wants to connect to the socket.

    however the connection never gets made.
    I think this is because the ip address is probably for the router in which the server phone is connected via wifi, and the router does not know the DHCP address of the phone.

    I am just wondering if there is a way to programatically solve this problem. i can't expect users to port forward their phone on every router the connect to via wifi


Comments

  • Registered Users, Registered Users 2 Posts: 1,477 ✭✭✭azzeretti


    EyeSight wrote: »
    Hi, I am running a serverSocket(port 4242) on an android phone(in java). a PC or another android device has the ip address of the server phone and wants to connect to the socket.

    however the connection never gets made.
    I think this is because the ip address is probably for the router in which the server phone is connected via wifi, and the router does not know the DHCP address of the phone.

    I am just wondering if there is a way to programatically solve this problem. i can't expect users to port forward their phone on every router the connect to via wifi

    Unless the server and phone are on a different network (across WAN/VLAN etc) then the router shouldn't come into it. Are you testing on a local network?


  • Registered Users, Registered Users 2 Posts: 7,156 ✭✭✭srsly78




  • Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭EyeSight


    i was testing on a local network and that worked fine. however when i try it on the internet it no longer works. it will need to work on the internet, not just a local network


  • Registered Users, Registered Users 2 Posts: 2,065 ✭✭✭Colonel Panic


    That is where uPnP comes in...


Advertisement
Advertisement