Click here to Skip to main content
15,917,328 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can not deserialize Pin
jschell1-Dec-10 12:16
jschell1-Dec-10 12:16 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 12:17
sitebuilderLuc Pattyn1-Dec-10 12:17 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 12:30
Jacob D Dixon1-Dec-10 12:30 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 13:06
sitebuilderLuc Pattyn1-Dec-10 13:06 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 14:48
Jacob D Dixon1-Dec-10 14:48 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 15:02
sitebuilderLuc Pattyn1-Dec-10 15:02 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 16:21
Jacob D Dixon1-Dec-10 16:21 
GeneralRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 16:46
sitebuilderLuc Pattyn1-Dec-10 16:46 
1. you would need a Length data member in your class, initially zero.

2.
I guess you have a BeginReceive() somewhere outside the callback; if so, just make it ask for 4 bytes. That is the easiest way.

3.
You can do all EndReceives in a single callback; the first time (when Length is still zero), you need an EndReceive that matches step #2, hope for 4 bytes, and decode them to an integer, to be stored in Length. Use BitConverter.ToInt32(). Later on (when Length isn't zero) do an EndReceive for a full load of data (the maximum of Length and your buffer size), and decrement Length. Keep doing till Length is zero, or timeout or other error occurs.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Can not deserialize [modified] Pin
Jacob D Dixon1-Dec-10 17:11
Jacob D Dixon1-Dec-10 17:11 
GeneralRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 22:22
sitebuilderLuc Pattyn1-Dec-10 22:22 
GeneralRe: Can not deserialize Pin
Jacob D Dixon2-Dec-10 4:57
Jacob D Dixon2-Dec-10 4:57 
AnswerRe: Can not deserialize Pin
Luc Pattyn2-Dec-10 5:19
sitebuilderLuc Pattyn2-Dec-10 5:19 
GeneralRe: Can not deserialize Pin
Jacob D Dixon2-Dec-10 6:09
Jacob D Dixon2-Dec-10 6:09 
GeneralRe: Can not deserialize Pin
Luc Pattyn2-Dec-10 6:30
sitebuilderLuc Pattyn2-Dec-10 6:30 
GeneralRe: Can not deserialize Pin
Jacob D Dixon2-Dec-10 7:56
Jacob D Dixon2-Dec-10 7:56 
GeneralRe: Can not deserialize Pin
Luc Pattyn2-Dec-10 8:20
sitebuilderLuc Pattyn2-Dec-10 8:20 
QuestionTrying to deal with the memory leak in the Flash Player Pin
jbradshaw1-Dec-10 6:09
jbradshaw1-Dec-10 6:09 
AnswerRe: Trying to deal with the memory leak in the Flash Player Pin
Luc Pattyn1-Dec-10 6:52
sitebuilderLuc Pattyn1-Dec-10 6:52 
GeneralRe: Trying to deal with the memory leak in the Flash Player Pin
jbradshaw1-Dec-10 7:27
jbradshaw1-Dec-10 7:27 
QuestionRe: Trying to deal with the memory leak in the Flash Player Pin
jbradshaw1-Dec-10 7:32
jbradshaw1-Dec-10 7:32 
AnswerRe: Trying to deal with the memory leak in the Flash Player Pin
Luc Pattyn1-Dec-10 7:42
sitebuilderLuc Pattyn1-Dec-10 7:42 
GeneralRe: Trying to deal with the memory leak in the Flash Player Pin
Pete O'Hanlon1-Dec-10 9:39
mvePete O'Hanlon1-Dec-10 9:39 
GeneralRe: Trying to deal with the memory leak in the Flash Player Pin
Luc Pattyn1-Dec-10 10:09
sitebuilderLuc Pattyn1-Dec-10 10:09 
GeneralRe: Trying to deal with the memory leak in the Flash Player Pin
Pete O'Hanlon1-Dec-10 10:23
mvePete O'Hanlon1-Dec-10 10:23 
GeneralRe: Trying to deal with the memory leak in the Flash Player Pin
Luc Pattyn1-Dec-10 11:07
sitebuilderLuc Pattyn1-Dec-10 11:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.