Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6821989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:36:36+00:00 2026-05-26T21:36:36+00:00

I’m having trouble connecting a socket from my android phone to my computer running

  • 0

I’m having trouble connecting a socket from my android phone to my computer running netcat listening on a port (5555).

What I run in my android app:

    try {
        Socket s = new Socket("My IP number here (not local IP)", 5555);
        DataOutputStream outToServer = new DataOutputStream(s.getOutputStream());
        outToServer.writeBytes("Hello!");
        s.close();
    } catch (UnknownHostException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

This is the line I use for netcat: nc -l 5555

I’m not sure what I’m missing..
I’ve forwarded the port on my router and rebooted the router. Added permission to internet in my android app.
The phone is connected via 3G and my computer is connected via broadband.
netcat is allowed in my firewall.

I get a SocketTimeoutException error in my app when trying to connect.

I guess the router takes care of handling which computer in the LAN will receive the request.

Anyone know what I’m missing?

EDIT: I think I might have tracked down the problem.. I have two options on my router Virtual Server and Port forwarding. I don’t know which to set to port 5555 in both UDP/TCP.
http://dl.dropbox.com/u/4385192/2011-11-19%2003.17.53%20pm.png
enter image description here
From what I understand it’s Virtual Server I should use instead of the port forwarding? If so, could someone clarify the difference between the two?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:36:36+00:00Added an answer on May 26, 2026 at 9:36 pm

    My computer had changed local IP since last configuration, so my Virtual Server/Port Forwarding rules did not apply, so I updated it (from 192.168.0.199 -> 192.168.0.196) and now it works excellently.

    So all steps applied:

    • Set a rule for Virtual Server/Port Forwarding on your router .
    • Set a rule for Inbound Filtering on your router in case you wish to only allow a whitelisted IP to connect and propagate to next security layer.
    • If your router has any other firewall settings, create rules to allow your connections to be made.
    • On your server/computer allow the ports in your firewall, or the application you’re running to receive inbound connections.
    • Profit!!!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.