Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralC#.NET Word adding a paragraph Pin
Nick Ingratta11-Nov-04 6:05
Nick Ingratta11-Nov-04 6:05 
GeneralRe: C#.NET Word adding a paragraph Pin
Heath Stewart11-Nov-04 7:33
protectorHeath Stewart11-Nov-04 7:33 
GeneralRe: C#.NET Word adding a paragraph Pin
Nick Ingratta11-Nov-04 8:42
Nick Ingratta11-Nov-04 8:42 
GeneralRe: C#.NET Word adding a paragraph Pin
Heath Stewart11-Nov-04 8:45
protectorHeath Stewart11-Nov-04 8:45 
GeneralRe: C#.NET Word adding a paragraph Pin
Nick Ingratta11-Nov-04 9:24
Nick Ingratta11-Nov-04 9:24 
GeneralRe: C#.NET Word adding a paragraph Pin
Heath Stewart11-Nov-04 15:43
protectorHeath Stewart11-Nov-04 15:43 
GeneralThrow SoapException in SoapExtension Pin
lopezrincon11-Nov-04 5:57
lopezrincon11-Nov-04 5:57 
GeneralStrange behaviour of StreamReader.Peek() Pin
SebbaP11-Nov-04 4:04
SebbaP11-Nov-04 4:04 
Hi!

I am writing a server/client application in which I need to transfer short text strings across a network from the server to the client. The message receiver in the client is running in its own thread, and it uses a stream reader to get the message strings from the TcpClient.

It appears that both the 'Read' and 'ReadLine' methods of the StreamReader class blocks until there is something on the stream (if it is empty when they are invoked). The problem is that not even a call to .Abort() will interrupt the Read(Line) metod (which is exactly what I want to do). Is there any way to abort a call to Read(Line)?

I have tried to use the Peek() method to determie whether or not the stream is empty. However, Peek() returns -1 even though ReadLine() returns with a string that is supposed to be there. Any thoughts on why this happens?

Does anyone no of a construct that provides a non-blocking read from a stream?


GeneralRe: Strange behaviour of StreamReader.Peek() Pin
Stefan Troschuetz11-Nov-04 4:45
Stefan Troschuetz11-Nov-04 4:45 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
Daniel Turini11-Nov-04 5:37
Daniel Turini11-Nov-04 5:37 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
leppie11-Nov-04 5:43
leppie11-Nov-04 5:43 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
SebbaP11-Nov-04 10:12
SebbaP11-Nov-04 10:12 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
Stefan Troschuetz11-Nov-04 22:04
Stefan Troschuetz11-Nov-04 22:04 
GeneralClearing DateTimePicker Pin
MagdyYousif11-Nov-04 2:29
MagdyYousif11-Nov-04 2:29 
GeneralRe: Clearing DateTimePicker Pin
Corinna John11-Nov-04 3:09
Corinna John11-Nov-04 3:09 
GeneralDATASETS Pin
Brendan Vogt11-Nov-04 1:29
Brendan Vogt11-Nov-04 1:29 
GeneralRe: DATASETS Pin
Skynyrd11-Nov-04 3:55
Skynyrd11-Nov-04 3:55 
GeneralRe: DATASETS Pin
Le centriste11-Nov-04 4:12
Le centriste11-Nov-04 4:12 
GeneralBinding Collection to DataGrid Pin
Derec Roofie11-Nov-04 1:24
Derec Roofie11-Nov-04 1:24 
GeneralRe: Binding Collection to DataGrid Pin
Daniel Turini11-Nov-04 2:07
Daniel Turini11-Nov-04 2:07 
GeneralRe: Binding Collection to DataGrid Pin
Derec Roofie11-Nov-04 5:18
Derec Roofie11-Nov-04 5:18 
GeneralRe: Binding Collection to DataGrid Pin
Daniel Turini11-Nov-04 5:26
Daniel Turini11-Nov-04 5:26 
QuestionHow to determin parent class Pin
Derec Roofie11-Nov-04 1:14
Derec Roofie11-Nov-04 1:14 
AnswerRe: How to determin parent class Pin
Daniel Turini11-Nov-04 2:06
Daniel Turini11-Nov-04 2:06 
GeneralC# attribute - hlp Pin
dstefan8210-Nov-04 23:45
dstefan8210-Nov-04 23:45 

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.