Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21221-Apr-09 3:05
hdv21221-Apr-09 3:05 
QuestionHow to convert (string -> xml) with window mobile Pin
YochangSong20-Apr-09 18:34
YochangSong20-Apr-09 18:34 
AnswerRe: How to convert (string -> xml) with window mobile Pin
N a v a n e e t h20-Apr-09 19:55
N a v a n e e t h20-Apr-09 19:55 
Questionplugin error Pin
Ch.Gayatri Subudhi20-Apr-09 18:24
Ch.Gayatri Subudhi20-Apr-09 18:24 
QuestionTab Control Pin
Piyush Vaishnav20-Apr-09 17:36
Piyush Vaishnav20-Apr-09 17:36 
AnswerRe: Tab Control Pin
Christian Graus20-Apr-09 17:46
protectorChristian Graus20-Apr-09 17:46 
QuestionAccessing webcam.. Pin
Jacob Dixon20-Apr-09 17:16
Jacob Dixon20-Apr-09 17:16 
AnswerRe: Accessing webcam.. Pin
Christian Graus20-Apr-09 17:36
protectorChristian Graus20-Apr-09 17:36 
GeneralRe: Accessing webcam.. Pin
Jacob Dixon20-Apr-09 18:16
Jacob Dixon20-Apr-09 18:16 
AnswerRe: Accessing webcam.. Pin
Amar Chaudhary20-Apr-09 19:23
Amar Chaudhary20-Apr-09 19:23 
AnswerRe: Accessing webcam.. Pin
Skymir21-Apr-09 3:04
Skymir21-Apr-09 3:04 
Questionreading contents of multiple text files Pin
mist_psycho20-Apr-09 15:50
mist_psycho20-Apr-09 15:50 
AnswerRe: reading contents of multiple text files Pin
N a v a n e e t h20-Apr-09 16:31
N a v a n e e t h20-Apr-09 16:31 
QuestionBinaryReader stuck on reading from NetworkStream Pin
Ady Shimony20-Apr-09 15:41
Ady Shimony20-Apr-09 15:41 
AnswerRe: BinaryReader stuck on reading from NetworkStream Pin
N a v a n e e t h20-Apr-09 16:45
N a v a n e e t h20-Apr-09 16:45 
GeneralRe: BinaryReader stuck on reading from NetworkStream Pin
Ady Shimony21-Apr-09 1:49
Ady Shimony21-Apr-09 1:49 
AnswerRe: BinaryReader stuck on reading from NetworkStream Pin
Rob Philpott20-Apr-09 22:35
Rob Philpott20-Apr-09 22:35 
No quite sure I understand exactly what you mean here, but the chances are the BinaryReader is blocking (eg. waiting for data to arrive) which is causing your hang. This makes sense, you can't read what hasn't been sent yet.

When sending data over a network stream, some buffering is employed too. So writing a single byte to the stream doesn't mean it will be transmitted. The .NET framework will wait until a certain amount of data is present in the stream before sending it. You can't send single byte network packets out. If you think that might be the problem take a look at flushing the underlying stream. This causes all the data in the buffer to be sent immediately.

Also, on something like this, you want to use multithreading. In particular the server will have multiple client connections, each needs to be served by its own thread. It's usual to send the TcpClient which is returned from AcceptTcpClient() to its own thread until the connection is closed. Without that, your server can only accept one connection at a time - surely not that good for a chat application.

Regards,
Rob Philpott.

GeneralRe: BinaryReader stuck on reading from NetworkStream Pin
Ady Shimony21-Apr-09 1:56
Ady Shimony21-Apr-09 1:56 
GeneralRe: BinaryReader stuck on reading from NetworkStream Pin
Rob Philpott21-Apr-09 2:48
Rob Philpott21-Apr-09 2:48 
GeneralRe: BinaryReader stuck on reading from NetworkStream Pin
Ady Shimony22-Apr-09 2:45
Ady Shimony22-Apr-09 2:45 
QuestionHow to free shared resources ? Pin
Moshe T20-Apr-09 14:01
Moshe T20-Apr-09 14:01 
AnswerRe: How to free shared resources ? Pin
Mycroft Holmes20-Apr-09 14:19
professionalMycroft Holmes20-Apr-09 14:19 
AnswerRe: How to free shared resources ? Pin
N a v a n e e t h20-Apr-09 16:53
N a v a n e e t h20-Apr-09 16:53 
QuestionGraphicsPath with Linecaps Pin
dh_20-Apr-09 11:49
dh_20-Apr-09 11:49 
AnswerRe: GraphicsPath with Linecaps Pin
Luc Pattyn20-Apr-09 13:50
sitebuilderLuc Pattyn20-Apr-09 13:50 

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.