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 9008101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:51:46+00:00 2026-06-16T01:51:46+00:00

Why does the android emulator connect to a socket server running on my PC

  • 0

Why does the android emulator connect to a socket server running on my PC but not receive any messages that are send back down the same line?

The android app connects to my C# socket server on 192.168.1.33 port 2012 successfully and messages can go from the android to the server no problem. Using the same socket connection I send a message down the socket to the android – but no message received on the android side.

I’ve tried various combinations of listening/connecting IP addresses (10.0.2.2, 10.0.2.15) as advised elsewhere and for some reason connecting to 127.0.0.1 doesn’t even seem to allow connection to my C# socket server at all.

I’ve attempted port forwarding on the android using:

    Telnet o localhost 5554
    redir add tcp:2012:2012

so that the port 2012 on my PC maps to the port 2012 on the emulator itself, but this doesn’t fix the problem.

The info on which is the correct IP address and port to use (along with the port forwarding stuff) is confusing…does anyone understand how to get this working?

Note: messages send back and forth between my C# client and server apps without a problem. It only doesn’t work correctly with the android acting as the client

  • 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-06-16T01:51:47+00:00Added an answer on June 16, 2026 at 1:51 am

    The solution was nothing to do with the connection or ports. The problem was with the data that I was sending back to the android device.

    A newline character is required for the socket to flush the information to the device:

        socket.Send(message + "\n");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Android emulator support OpenGl ES2.0? I run the code but Eclipse gives me
Android Emulator Icon in windows 7 does not show in TaskBar..see my Image... I
Does Android support virtual memory concept? I read it does use paging but not
android emulator does not recognize hebrew font where my phone does how do I
When i try to connect internet with android 2.2 from emulator can not connect.
I'm trying to write a java code on an Android emulator that will send
Possible Duplicate: slow android emulator Does anybody know why the emulator is that slow?
Does android supports log2 ? I already find that android doesnt support long double.
I am trying to create a simple Icon+Text ListView but it does not work.
I'm trying to record sound using Android Emulator. I know that this question is

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.