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

The Archive Base Latest Questions

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

I am writing an application (a multiplayer game) where objects need to be passed

  • 0

I am writing an application (a multiplayer game) where objects need to be passed from one instance of the application to another (and very quickly) via a server.

I am using ObjectOutputStreams and ObjectInputStreams obtained through the sockets to do this.

However, the state of the objects being passed is constantly being updated, meaning the typical writeObject() method won’t do the trick (it only writes the object once, then passes a reference to it subsequent times it is called, meaning the values of its instance variables are never actually updated).

To “fix” this I have been calling the ObjectOutputStream.reset() method after every call to writeObject(), which does solve the problem of updating the object state; however, it runs much too slow, which I assume is a result of the objects being passed in their entirety each “refresh”.

My question then is, how do I update the state of the object I am passing over the network without having to entirely rewrite the object? (I’m assuming this is how I would speed things up; if I’m wrong, or if other methods exist, please share) Thank you in advance for any advice!

Also, regarding the size of the object being passed: it isn’t overly large… A couple of boolean variables, a couple of double arrays, and some other minor variables (No lists of length 1000 each containing another list).

  • 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:07:03+00:00Added an answer on June 5, 2026 at 8:07 pm
    1. Use a BufferedOutputStream between the ObjectOutputStream and the socket.
    2. Use a BufferedInputStream between the ObjectInputStream and the socket.
    3. Call flush() after every writeObject() or writeUnshared().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing the server-side networking of a multiplayer game. The game is an
Im writing an application for workers in our factory and one of requirements is
I writing simple application that need to make some record of the incoming sound.
I'm writing an application in C# which needs to attach one of its own
I am writing an application that is accepting POST data from a third party
I'm writing application which consists of server side on Google App Engine (Java) and
Writing an application in Cocoa that will take input from the user, format it
Im writing a application that reads logs from 1-many computers in the network. The
Am writing an application for iphone to run as mobile web server by assigning
Im rewriting application from .NET to PHP. I need to create class like this:

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.