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

C#

 
GeneralRe: Why can't I change Row during Insert?? Pin
Besinci28-Apr-05 11:53
Besinci28-Apr-05 11:53 
GeneralDeployment Project: Getting Property Value into DWORD Registry Entry Pin
mwhouser27-Apr-05 13:45
mwhouser27-Apr-05 13:45 
Questionstream? how does it work? Pin
Snowjim27-Apr-05 12:26
Snowjim27-Apr-05 12:26 
AnswerRe: stream? how does it work? Pin
Dave Kreskowiak27-Apr-05 16:28
mveDave Kreskowiak27-Apr-05 16:28 
GeneralRe: stream? how does it work? Pin
Snowjim27-Apr-05 22:44
Snowjim27-Apr-05 22:44 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 3:35
turbochimp28-Apr-05 3:35 
GeneralRe: stream? how does it work? Pin
Snowjim28-Apr-05 6:47
Snowjim28-Apr-05 6:47 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 7:22
turbochimp28-Apr-05 7:22 
As I understand it, a NetworkStream really just wraps a Socket. When Read (or BeginRead) is called on the stream, it actually executes a Receive (or BeginReceive) on the Socket. The NetworkStream itself does not appear to have an intrinsic buffer (byte[]) the way a FileStream does.

NetworkStream actually does its work with unsafe code calls on a Socket below the surface.

If you need to periodically clear the stream, you could do so by just clearing the previously read portion of the stream or something, perhaps by reading the as-yet-unread portion of the buffer into memory, then creating a new stream with only that data (or as suggested before, implement your own stream for doing it), but either way, it may be important to synchronize your stream writing code and possibly your reading code when such an even occurs - you could lock the stream, clear the read portion, raise an event that it's been truncated, and unlock it.

Hope this helps.

The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

GeneralRe: stream? how does it work? Pin
Snowjim28-Apr-05 7:31
Snowjim28-Apr-05 7:31 
GeneralRe: stream? how does it work? Pin
turbochimp28-Apr-05 7:46
turbochimp28-Apr-05 7:46 
GeneralAPI commands Pin
c00lguy27-Apr-05 12:13
c00lguy27-Apr-05 12:13 
GeneralRe: API commands Pin
Dave Kreskowiak27-Apr-05 16:22
mveDave Kreskowiak27-Apr-05 16:22 
GeneralRe: API commands Pin
c00lguy28-Apr-05 1:12
c00lguy28-Apr-05 1:12 
QuestionWinForm problem please help? Pin
OnlyTaz27-Apr-05 10:40
OnlyTaz27-Apr-05 10:40 
AnswerRe: WinForm problem please help? Pin
Besinci27-Apr-05 14:43
Besinci27-Apr-05 14:43 
GeneralRe: WinForm problem please help? Pin
OnlyTaz27-Apr-05 14:56
OnlyTaz27-Apr-05 14:56 
GeneralRe: WinForm problem please help? Pin
Dave Kreskowiak27-Apr-05 16:19
mveDave Kreskowiak27-Apr-05 16:19 
Generalwinforms app to control browser Pin
fortyonejb27-Apr-05 10:09
fortyonejb27-Apr-05 10:09 
GeneralRe: winforms app to control browser Pin
MoustafaS27-Apr-05 10:18
MoustafaS27-Apr-05 10:18 
GeneralRe: winforms app to control browser Pin
fortyonejb27-Apr-05 15:50
fortyonejb27-Apr-05 15:50 
GeneralRe: winforms app to control browser Pin
Dave Kreskowiak27-Apr-05 16:17
mveDave Kreskowiak27-Apr-05 16:17 
GeneralRe: winforms app to control browser Pin
fortyonejb27-Apr-05 18:03
fortyonejb27-Apr-05 18:03 
GeneralRe: winforms app to control browser Pin
Carl Mercier28-Apr-05 2:06
Carl Mercier28-Apr-05 2:06 
GeneralRe: winforms app to control browser Pin
fortyonejb28-Apr-05 14:11
fortyonejb28-Apr-05 14:11 
GeneralAdding a key to the registry Pin
Anonymous27-Apr-05 10:02
Anonymous27-Apr-05 10:02 

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.