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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:17:11+00:00 2026-06-03T16:17:11+00:00

So I recently followed this tutorial on making a basic chatroom in Java. It

  • 0

So I recently followed this tutorial on making a basic chatroom in Java. It uses multithreading and is a “connection-oriented” server. I was wondering how I could use the same Sockets and ServerSockets to send, say, the 3d position of an object instead of just a string?

Currently, the basic chatroom system just sends a string to the server and then the server sends it to all connected clients. What I want is to be able to have a client change the position of an object (most likely their character), and send the change of position to the server. Then (I would imagine) the server would send that change in position to each of the clients connected to it, and each client would in turn render this object at its new position.

I was wondering what the best way to do something like this was?
Would it be to send a string and have the server parse it into a coordinate?
Can I write more than one thing to a DataOutputStream at once?

I feel like I may have explained this poorly, so please ask some clarifying questions.

Thanks!

  • 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-03T16:17:13+00:00Added an answer on June 3, 2026 at 4:17 pm

    Create a Domain Object Model for your coordinate system. Then represent the changes to the positions using the objects in the above model. Serialize them into a transportable string like XML, JSON etc. Then unmarshall/deserialize the String to the original object and act upon them.

    This separates your transport layer (using sockets to bradcast stuff) from the actual business logic (placement of objects) and the system becomes extendible.

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

Sidebar

Related Questions

I recently followed this tutorial on Google Cloud SQL and GWT: http://code.google.com/apis/sql/docs/developers_guide_java.html I deployed
I recently followed a small tutorial on howto install apache on a systems where
I got to know about this Java 1.5 capability recently and I developed a
I recently followed Ray Wenderlich's Cocos2D tutorial for putting Cocos2D in a UIKit app.
I recently downloaded cakephp-1.3.4. I set it up on my web server. I followed
I recently followed Scott Hansleman's instructions on setting up SSL locally using IIS Express
I recently followed some instructions with RVM to install ruby-debug and I think it
Recently We started on optimizing a database which never followed any standards. We though
I recently installed xampp, followed the installation. MySQL/apache. (I have same website running on
Recently I was trying some practice programs in python and I came across 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.