Click here to Skip to main content
15,908,013 members
Home / Discussions / C#
   

C#

 
GeneralRe: Memory is available or not at declaring the object. Pin
Eddy Vluggen15-Sep-11 6:38
professionalEddy Vluggen15-Sep-11 6:38 
AnswerRe: Memory is available or not at declaring the object. Pin
PIEBALDconsult15-Sep-11 2:58
mvePIEBALDconsult15-Sep-11 2:58 
QuestionBitmaps [modified] Pin
Member 780730914-Sep-11 16:56
Member 780730914-Sep-11 16:56 
AnswerRe: Bitmaps Pin
Abhinav S14-Sep-11 17:22
Abhinav S14-Sep-11 17:22 
AnswerRe: Bitmaps Pin
Dave Kreskowiak14-Sep-11 18:11
mveDave Kreskowiak14-Sep-11 18:11 
GeneralRe: Bitmaps Pin
Mycroft Holmes14-Sep-11 19:52
professionalMycroft Holmes14-Sep-11 19:52 
GeneralRe: Bitmaps Pin
OriginalGriff14-Sep-11 21:28
mveOriginalGriff14-Sep-11 21:28 
GeneralRe: Bitmaps Pin
Mycroft Holmes14-Sep-11 22:36
professionalMycroft Holmes14-Sep-11 22:36 
GeneralRe: Bitmaps Pin
V.14-Sep-11 20:25
professionalV.14-Sep-11 20:25 
GeneralRe: Bitmaps Pin
OriginalGriff14-Sep-11 21:29
mveOriginalGriff14-Sep-11 21:29 
GeneralMessage Removed Pin
16-Sep-11 5:29
professionalN_tro_P16-Sep-11 5:29 
GeneralRe: Bitmaps Pin
Dave Kreskowiak16-Sep-11 12:08
mveDave Kreskowiak16-Sep-11 12:08 
AnswerRe: Bitmaps Pin
MicroVirus15-Sep-11 4:06
MicroVirus15-Sep-11 4:06 
GeneralRe: Bitmaps Pin
Dave Kreskowiak15-Sep-11 9:32
mveDave Kreskowiak15-Sep-11 9:32 
QuestionSerialPort class DataReceived event question Pin
Ken Booth14-Sep-11 11:38
Ken Booth14-Sep-11 11:38 
AnswerRe: SerialPort class DataReceived event question Pin
Richard Andrew x6414-Sep-11 12:04
professionalRichard Andrew x6414-Sep-11 12:04 
GeneralRe: SerialPort class DataReceived event question Pin
Ken Booth14-Sep-11 12:23
Ken Booth14-Sep-11 12:23 
AnswerRe: SerialPort class DataReceived event question Pin
Luc Pattyn14-Sep-11 16:25
sitebuilderLuc Pattyn14-Sep-11 16:25 
I am not surprised, asynchronous receive is a complex process, there are several actors, and some buffers with their sizes and thresholds, some of which one cannot control at all.

You should not be lazy and refuse to loop over the bytes you get in one go, that is pretty easy to accomplish.

It gets really nasty when you have to implement a message-oriented protocol, where the sender sends two or more messages back-to-back, and your receiver unfortunately receives three or more DataReceived events, each covering an arbitrary part of the messages sent (say first half of first msg, then second half+first half of second msg, finally second half of second message).

The only serial receive that goes smoothly is the one that has a fixed message separator (say a NEWLINE) which is guaranteed to appear in between messages and never inside a message (in that case set the NewLine property and use ReadLine). If that is not the case, get ready to collect what you get, whatever amount comes in, then re-packetize it according to your needs.

And then, you should carefully consider whether you need some recovery mechanism, something that helps you out in case some character gets damaged or lost...

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: SerialPort class DataReceived event question Pin
Ken Booth14-Sep-11 20:21
Ken Booth14-Sep-11 20:21 
QuestionHow do I change the connection string for Database Designer-designed objects? Pin
Interrobang14-Sep-11 7:52
Interrobang14-Sep-11 7:52 
AnswerRe: How do I change the connection string for Database Designer-designed objects? Pin
Mycroft Holmes14-Sep-11 14:35
professionalMycroft Holmes14-Sep-11 14:35 
AnswerRe: How do I change the connection string for Database Designer-designed objects? Pin
PIEBALDconsult14-Sep-11 15:11
mvePIEBALDconsult14-Sep-11 15:11 
QuestionAxWindowsMediaPlayer Pin
Francesco-8014-Sep-11 7:08
Francesco-8014-Sep-11 7:08 
AnswerRe: AxWindowsMediaPlayer Pin
Francesco-8015-Sep-11 1:18
Francesco-8015-Sep-11 1:18 
Questionwhat is the "game engine"???? Pin
gif202013-Sep-11 23:40
gif202013-Sep-11 23:40 

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.