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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:11:02+00:00 2026-06-05T20:11:02+00:00

i am trying to link a Unity game to a Java server using C#

  • 0

i am trying to link a Unity game to a Java server using C#

when the Java server up the only way i can send data is by closing the StreamWriter (OUT.Close();) which actually closes the connection too. so i can only send data onces. or, every time i want to send a message, i have to reconnect to the server again.

when i just use Flush(), the data will not be send to the server.
Code:

NetworkStream STREAM = connection.GetStream();
StreamWriter OUT = new StreamWriter(STREAM);
OUT.Write(text);
OUT.Flush()

this is my reading code:

BufferedReader input = new BufferedReader(new InputStreamReader(client.getInputStream()));
String inputstring = input.readLine(); 
  • 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-05T20:11:03+00:00Added an answer on June 5, 2026 at 8:11 pm

    You write text without a line separator with Write and read with ReadLine, so this doesn’t match up. In the absence of line separators, ReadLine reads to the end of the stream, which explains why you need to close the stream. Replace Write with WriteLine.

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

Sidebar

Related Questions

Im trying to link my program to the shared library. Im using a makefile
I am trying to link to an external link using the anchor tag like
I'm trying to link two tables in the same database using a third. The
I am trying to link a remote database to a local database using dblink.
I'm trying to link to an external stylesheet using this code: <?php include(/homepages/9/myusername/htdocs/Mobile_Detect.php); $detect
Here is a snippet (if you are using Opera, check out this link). As
I am trying to link a C++ module using GCC, essentially like this: gcc
I'm trying to link to the YUI reset stylesheet in my RoR layout using
I'm trying to figure out how can I make one anchor tag that will
I'm trying link two tables together using a foreign key. One table is users,

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.