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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:34:44+00:00 2026-05-29T22:34:44+00:00

How to tell what type of object is being sent over a socket if

  • 0

How to tell what type of object is being sent over a socket if the server side code looks like this

        NetworkStream stream = socket.GetStream();
        BinaryFormatter formatter = new BinaryFormatter();
        formatter.Serialize(stream,objectToBeSent);
  • 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-29T22:34:45+00:00Added an answer on May 29, 2026 at 10:34 pm

    On the client I suppose you are going to read the data sent by the server and deserialize it back:

    object sentObject = formatter.Deserialize(stream);
    Type objectType = sentObject.GetType();
    

    For this to work you will obviously need to include the assembly containing the serialized type on the client.

    Oh and bare in mind that the BinaryFormatter class uses a non-interoperable format. This means that if you use for example different versions of the .NET frmaeowrk on the client and server this might not work. If this is the case you should use some interoperable data format protocol to exchange information between a server and a client.

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

Sidebar

Related Questions

I use a site that looks like this: ... <body> <iframe src=blabla/blabla...></iframe> </body> ...
I'm currently receiving a serialized object through a socket connection, this works flawlessly. I'm
Well, I'm completely new to JavaScript. Can you please tell me what type of
can you just tell me for which type of requirement we should choose framework
Can GHC or some lint tool tell me when I've provided a type signature
I'm currently writing DataTemplate for my custom type lets say FootballPlayer. In this template
I was wondering if anyone could tell me if this kind of behaviour is
I'm using SqlBulkCopy to insert/update from a .net DataTable object to a SQL Server
Please consider the following code: type TFoo1 = class public procedure DoSomething1; end; TFoo2
Does anyone know of an irrational number representation type/object/class/whatever in any programming language? All

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.