Click here to Skip to main content
15,915,319 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Luc Pattyn12-May-09 17:12
sitebuilderLuc Pattyn12-May-09 17:12 
AnswerRe: Retrieving USB Barcode scanner data... Pin
Dave Kreskowiak12-May-09 17:19
mveDave Kreskowiak12-May-09 17:19 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Mycroft Holmes12-May-09 19:07
professionalMycroft Holmes12-May-09 19:07 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Jacob Dixon13-May-09 3:06
Jacob Dixon13-May-09 3:06 
AnswerRe: Retrieving USB Barcode scanner data... Pin
cackharot27-May-09 15:03
cackharot27-May-09 15:03 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Jacob Dixon28-May-09 4:17
Jacob Dixon28-May-09 4:17 
QuestionSending file via TCP protocol Pin
nike_arh12-May-09 10:31
nike_arh12-May-09 10:31 
AnswerRe: Sending file via TCP protocol Pin
Luc Pattyn12-May-09 14:11
sitebuilderLuc Pattyn12-May-09 14:11 
Hi,

you shouldn't give up once ns.DataAvailable is false, that could happen any time: maybe the server is temporarily busy (say waiting on disk I/O, serving other clients, ..) or the client has a more powerful machine, hence it would run ahead.

A better approach would be for the client to either just ignore ns.DataAvailable (now the client would hang if the server exits unexpectedly) or allow for a later retry (say when false, wait 100 msec and try again) which increases the odds, but exits gracefully when the communication really goes wrong.

If it goes wrong, add some logging statements to both server and client so you can see where it fails.
Example: Console.WriteLine("server: readBytes="+readBytes);

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Sending file via TCP protocol Pin
nike_arh12-May-09 23:35
nike_arh12-May-09 23:35 
GeneralRe: Sending file via TCP protocol Pin
Luc Pattyn13-May-09 0:03
sitebuilderLuc Pattyn13-May-09 0:03 
QuestionCurious Question about ProgressBar object between two classes Pin
Blubbo12-May-09 9:52
Blubbo12-May-09 9:52 
AnswerRe: Curious Question about ProgressBar object between two classes Pin
Christian Graus12-May-09 10:00
protectorChristian Graus12-May-09 10:00 
GeneralRe: Curious Question about ProgressBar object between two classes Pin
Blubbo13-May-09 2:19
Blubbo13-May-09 2:19 
QuestionConverting between types inside Lambda Expressions Pin
Andre Vianna12-May-09 8:59
Andre Vianna12-May-09 8:59 
QuestionDraw railway using Graphics GDI+ Pin
baranils12-May-09 8:49
baranils12-May-09 8:49 
AnswerRe: Draw railway using Graphics GDI+ Pin
Christian Graus12-May-09 9:14
protectorChristian Graus12-May-09 9:14 
GeneralRe: Draw railway using Graphics GDI+ Pin
baranils12-May-09 9:42
baranils12-May-09 9:42 
GeneralRe: Draw railway using Graphics GDI+ Pin
Christian Graus12-May-09 10:00
protectorChristian Graus12-May-09 10:00 
AnswerRe: Draw railway using Graphics GDI+ Pin
Mark Churchill12-May-09 18:27
Mark Churchill12-May-09 18:27 
GeneralRe: Draw railway using Graphics GDI+ Pin
baranils12-May-09 19:47
baranils12-May-09 19:47 
QuestionMoving an array element to a variable. Pin
Lecutus112-May-09 8:18
Lecutus112-May-09 8:18 
AnswerRe: Moving an array element to a variable. Pin
OriginalGriff12-May-09 8:26
mveOriginalGriff12-May-09 8:26 
AnswerRe: Moving an array element to a variable. Pin
Dave Kreskowiak12-May-09 8:49
mveDave Kreskowiak12-May-09 8:49 
AnswerRe: Moving an array element to a variable. Pin
Lecutus113-May-09 6:02
Lecutus113-May-09 6:02 
QuestionHow to convert OCX file into C# Pin
dwark10612-May-09 7:48
dwark10612-May-09 7:48 

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.