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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:04:10+00:00 2026-05-24T08:04:10+00:00

I want to build a server/client engine for a game that I will eventually

  • 0

I want to build a server/client engine for a game that I will eventually be making.

While planning, I find that I’m stuck on one aspect: Sending objects across a network.

My goals for the client/server are:

  • The client/server that I am describing is a ‘world’ server, and thus will use TCP to communicate.
  • The server and/or client must be able to send any serializable object to eachother, and the receiver must be able to deserialize it on their end.
  • The serialization method preferred would be binary.

However, I don’t know how to send serialized data over a network socket. Sending a string is easy… You can simply append a terminator string to the end and wait for that to be received. I don’t know how you can do something equivalent with objects; so any ideas/help/tutorials will be appreciated.

Thank you.

  • 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-05-24T08:04:10+00:00Added an answer on May 24, 2026 at 8:04 am

    I’m biased (as the author), but protobuf-net would be an excellent fix here:

    • binary, efficient (both CPU and bandwidth) format
    • very version tolerant
    • cross-platform (protobuf)

    In particular, the SerializeWithLengthPrefix and DeserializeWithLengthPrefix (etc) are well-suited to socket use, as this handles the segmentation of messages for you. If you want, you can also use a variant here (and the non-generic API) to send any of a range of messages and have it recognise the message type based on a pre-defined number you think of.

    This way, the library does all the worrying about getting the object onto the wire. The only sticking point is your definition of “any serializable object” – as long as the client/server agree on the types of messages involved, it’ll be fine – but “any” is a bit trickier.

    If you have an example model (it doesn’t have to be your “real” model), feel free to add it and I’ll show how it can be used in this way.

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

Sidebar

Related Questions

I'm trying to build a simple echo server/client that works on ethernet level(using raw
I want to create an application which will have a client and server components.
I want to build a website that display changing text-messages. The server gets the
I want to build an upload applet / desktop client that can resize -
Basically I want to build a web interface to a server-side math engine. (Like
I want to build an Http Server which will serve the requests of a
I am about to build a system that will have its own engine, as
I want to build an FTP server that has no actual files in the
I want to build a REST Client on an android phone. The REST server
I want to set up a continuous integration / build server for a C#

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.