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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:41:09+00:00 2026-05-28T15:41:09+00:00

I am Sending Serialized large Image Object over UDP Socket .When I write all

  • 0

I am Sending Serialized large Image Object over UDP Socket.When I write all received bytes in Memory stream and pass the memory stream object for deserialization it throws an exception No assembly ID for object type ‘ImagePacket’.

Receiver End Code:

                 ImageStream = new MemoryStream();

                while (AccumulatingBytes <= TotalSizeOfComplexObject)
                 {

                  byte[] Recievedbytes = UdpListener.Receive(ref RemoteEndPoint);

                  ImageStream.Write(Recievedbytes, 0, Recievedbytes.Length);

                   AccumulatingBytes += Recievedbytes.Length;
                 } 


                  ImageStream.Position = 0;

                    imagecontainer = (ImageContainer)bformater.Deserialize(ImageStream);//Here the Code Segment Breaks and Exception thrown
  • 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-28T15:41:10+00:00Added an answer on May 28, 2026 at 3:41 pm

    I suspect the problem here is simply: you are using UDP like it is TCP. UDP is packet based, but a: doesn’t guarantee that the packets will arrive in order, and b: doesn’t guarantee that packets won’t be dropped or duplicated.

    I fully expect you have some out of order. If you are sending multiple messages, it is also possible some were dropped, and you’ve included a few from the next message.

    To use the network the way your code wants to use it: use TCP. Otherwise, the responsibility for making sense of out-of-order, dropped and duplicated packets is entirely yours. This could be, for example, by adding a sequence number to the packet, and keeping track of what has been received – re-ordering them as necessary, dropping duplicates, and re-requesting any that died en-route. Basically, re-writing everything that TCP adds! Unless you have a very specific scenario, there’s a good chance that the TCP stack (with NIC and OS level support) will do a better job of this than you will.

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

Sidebar

Related Questions

I am Sending Jpeg Encoded Images as Serialized Complex object over UDP Socket ..As
I'm sending a C struct over UDP struct packet{ int numInt; int* intList; //malloc'ed
I've seen lots of examples of sending serialized data over sockets in Java, but
Is there any performance advantage of using content type application/json sending an object serialized
I am currently trying to send a serialized object over a TCP connection as
sending mail along with embedded image using asp.net I have already used following but
When sending data over HTTPS, I know the content is encrypted, however I hear
I am sending serialized objects via a NetWorkStream to another computer, on the receiving
When an object is serialized (by remoting to be sent across the wire) does
I have an applet trying to send java serialized object to a servlet (hosted

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.