Click here to Skip to main content
15,887,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: Entity Frame work Pin
TnTinMn14-May-13 11:12
TnTinMn14-May-13 11:12 
GeneralRe: Entity Frame work Pin
AspDotNetDev14-May-13 11:16
protectorAspDotNetDev14-May-13 11:16 
AnswerRe: Entity Frame work Pin
Dave Kreskowiak14-May-13 3:46
mveDave Kreskowiak14-May-13 3:46 
QuestionHow would you clear a tcp buffer or detect if there is data there ? Pin
Member 986287213-May-13 21:40
Member 986287213-May-13 21:40 
AnswerRe: How would you clear a tcp buffer or detect if there is data there ? Pin
SoMad13-May-13 22:43
professionalSoMad13-May-13 22:43 
GeneralRe: How would you clear a tcp buffer or detect if there is data there ? Pin
Member 986287215-May-13 4:30
Member 986287215-May-13 4:30 
AnswerRe: How would you clear a tcp buffer or detect if there is data there ? Pin
Richard MacCutchan13-May-13 22:45
mveRichard MacCutchan13-May-13 22:45 
AnswerRe: How would you clear a tcp buffer or detect if there is data there ? Pin
jschell14-May-13 9:28
jschell14-May-13 9:28 
TCP sends messages. You get rid of the message by reading it. All of it.

It gets 'stuck' because it is doing a blocking read because there is nothing left to read.

The simple and correct solution is to read the entire message. If you cannot accurately determine the message size then you have a problem that is likely not solvable.

If the device itself is failing to send a complete message then you can use a timeout to attempt to read the complete message. However that doesn't help on the next message if the rest of the message came in later.

Why not just drop and recreate the connection each time?
Questionruntime error Pin
n.nili13-May-13 19:04
n.nili13-May-13 19:04 
AnswerRe: runtime error Pin
Pete O'Hanlon13-May-13 21:22
mvePete O'Hanlon13-May-13 21:22 
AnswerRe: runtime error Pin
dusty_dex13-May-13 22:20
dusty_dex13-May-13 22:20 
Questionstring concatenation with all possibilities Pin
sethupathiram13-May-13 3:19
sethupathiram13-May-13 3:19 
AnswerRe: string concatenation with all possibilities Pin
Pete O'Hanlon13-May-13 3:30
mvePete O'Hanlon13-May-13 3:30 
AnswerRe: string concatenation with all possibilities Pin
Simon_Whale13-May-13 3:38
Simon_Whale13-May-13 3:38 
AnswerRe: string concatenation with all possibilities Pin
PIEBALDconsult13-May-13 4:33
mvePIEBALDconsult13-May-13 4:33 
AnswerRe: string concatenation with all possibilities Pin
Richard Deeming13-May-13 5:06
mveRichard Deeming13-May-13 5:06 
AnswerRe: string concatenation with all possibilities Pin
Anna King14-May-13 2:56
professionalAnna King14-May-13 2:56 
QuestionError 1 The type or namespace name 'Form1' Pin
Topias Jäppilä13-May-13 2:06
Topias Jäppilä13-May-13 2:06 
QuestionRe: Error 1 The type or namespace name 'Form1' Pin
Richard MacCutchan13-May-13 2:39
mveRichard MacCutchan13-May-13 2:39 
AnswerRe: Error 1 The type or namespace name 'Form1' Pin
Topias Jäppilä13-May-13 4:44
Topias Jäppilä13-May-13 4:44 
GeneralRe: Error 1 The type or namespace name 'Form1' Pin
Richard MacCutchan13-May-13 5:02
mveRichard MacCutchan13-May-13 5:02 
GeneralRe: Error 1 The type or namespace name 'Form1' Pin
Topias Jäppilä13-May-13 5:08
Topias Jäppilä13-May-13 5:08 
GeneralRe: Error 1 The type or namespace name 'Form1' Pin
Richard MacCutchan13-May-13 5:18
mveRichard MacCutchan13-May-13 5:18 
AnswerRe: Error 1 The type or namespace name 'Form1' Pin
Simon_Whale13-May-13 4:51
Simon_Whale13-May-13 4:51 
AnswerRe: Error 1 The type or namespace name 'Form1' Pin
Anna King14-May-13 3:14
professionalAnna King14-May-13 3:14 

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.