Re: Best approach?



The thing you want to achieve is called serialization( packing class into
bytes ) and deserialization ( unpacking class ).

..NET serizalization is pretty simple process, consult the docs
(
http://www.codeguru.com/Csharp/Csharp/cs_syntax/serialization/article.php/c7201/ )
(
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconbinaryserialization.asp )

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Dan" <dvazanias@xxxxxxx> wrote in message
news:ukyEYKRHGHA.240@xxxxxxxxxxxxxxxxxxxxxxx
>I presume that to send anything i have to convert it into bytes, send it
>then extract it at the other end.
>
> Is it possible to say have a class myClass and send it as an object
>
> so in pseudo code
>
> SendData (myClass);
>
> then at the other end
>
> myClass _obj = new myClass();
> _obj = ReceiveData(myClass);
>
>
> Is that possible? or do i have to send each part of it separately,
> variable per variable etc and then rebuild it at the other end? Could
> someone provid sample code if possible, c# .
>
> --
> Dan
>


.



Relevant Pages

  • Re: Best approach?
    ... packing, alignment, byte ordering (big-endian/ little-endian) at least. ... You suould define an 'on-wire' format (in network byte order) for the data ... > Is it possible to say have a class myClass and send it as an object ... > someone provid sample code if possible, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Best approach?
    ... So i should send the variables that i need when i need them and load them ... So best practice is lots of small packets rather than less packets but ... > Is it possible to say have a class myClass and send it as an object ... > someone provid sample code if possible, ...
    (microsoft.public.win32.programmer.networks)

Loading