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

  • Home
  • SEARCH
  • 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 8242207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:05:21+00:00 2026-06-07T21:05:21+00:00

for an mmo I am attempting to create, I have an android client connecting

  • 0

for an mmo I am attempting to create, I have an android client connecting to a java server. The android is running on the emulator while the server is running straight on my computer. They can connect fine and acknowledge the connection but the client stops at an odd place and I can’t figure out why.

The server’s WorkerThread’s Run method:

public void run() {
    try {
        InputStream input  = clientSocket.getInputStream();
        OutputStream output = clientSocket.getOutputStream();
        String returns="";
        String s="";
        try{
        s= inputStreamToString(input).toString();
        }
        catch(Exception e)
        {}
       output.write(("HTTP/1.1 200 OK\n\nWorkerRunnable: " +
               this.serverText + " - " +
               "").getBytes());
        output.close();
        input.close();
    } catch (IOException e) {
        //report exception somewhere.
        e.printStackTrace();
    }
}

The InputStream stringbulider:

private static StringBuilder inputStreamToString(InputStream is) {
    String line = "";
    StringBuilder total = new StringBuilder();

    BufferedReader rd = new BufferedReader(new InputStreamReader(is));

    try {
        while ((line = rd.readLine()) != null) {
            total.append(line);
        }
    } catch (Exception e) {
    }

    return total;}

The client’s connection method:

      public String sendMessage(String message)
      {
try{        clientSocket = new Socket("10.0.2.2", 9000);

          String modifiedSentence;
          DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
          BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
          outToServer.writeBytes(message+"\n");
              //Stops here
          modifiedSentence = inFromServer.readLine();
          outToServer.close();
          inFromServer.close();
          clientSocket.close();
          Log.v(modifiedSentence, modifiedSentence);
          return modifiedSentence;}
catch(Exception e)
{
    return "";}

      }

Thanks, any help will be appreciated.

EDIT: update if I close either the client or the server the other can recieve the former’s message but they can’t if both are open…

  • 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-07T21:05:24+00:00Added an answer on June 7, 2026 at 9:05 pm

    Try this:

    outToServer.writeBytes(message+"\n");
    outToServer.flush(); // Flush output to socket
    modifiedSentence = inFromServer.readLine();
    

    Also check if the data is actually getting received by your server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a server for a client-server game (ideally the basis for small MMO)
I have the idea to dev a gaming server (not a mmo server, but
I'm working on a flash MMO with a c# server. I have a simple
I'm creating a browser-based game (MMO) with a server and client, all using PHP,
In an MMO game client, I need to create a loop that will loop
I'm trying to make an online MMO in Java. It will be a simple
I want to write an mmo game server, but I can't seem to find
I'm making an MMO which will have a 2d world. (This is a learning
I have have a small prototype game in java where players can build their
We're building a MMO server, highly optimized for latency. So, with the CLR 4.0

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.