views:

94

answers:

4

I want to use method Stream.Flush but its documentation shows that message. What does it mean?

EDIT: I have not found any solution in the MSDN thread. My problem is that sometimes sending a message and client disconnecting causes the message doesn't appear. So I would need to flush the stream or socket in the OnDisconnecing event.

+5  A: 

They hired a guy who was half French and half English , to do the docs?
Jokes apart, it means: This method is reserved for future use ie. The method that is being reffered to has been created so that the "thing" complies with some sort of spec. , but it is just a placeholder and will be implemented later.

Aviral Dasgupta
+3  A: 

It means that the authors of the Stream implementation you are using haven't implemented the Flush method so you don't have to call it in your code.

Darin Dimitrov
No, that's not what it means. It means that in the current implementation, it does nothing, but you should call it even so, because when they do implement it and require you to call it, your code still works correctly. That is, *if* you need to call flush.
Lasse V. Karlsen
A: 

If you are using NetworkStream then please visit this thread on MSDN.

TheVillageIdiot
Im using network stream. I dont have problems with parsing messages, I have a problem that sometimes the message send before disconnecting doesnt come.Like:SendMessage(text, param)DisconectClient(client)
Tomas
Well, you could change things so that the client confirms it receieved the message and then you could disconnect...
Aviral Dasgupta
I think that TCP/IP ensures that the msg came. Its like when you inform the client that his password attempt was wrong. You send the msg and disconnect it.It has something to do with immediate calling disconnect. When I remove it, all msg come correctly of course.
Tomas
A: 

Basically it means that the abstract method Stream.Flush() had to be implemented, but it doesn't do anything in the concrete implementation of NetworkStream. I believe the .NET framework relies upon the OS to do the flushing over the network.

TigerShark
So I dont need to call it? There is no buffering since it writes to sockets?
Tomas
You should still call it. If in .NET 4.0, Flush is implemented and you should call it, your code still works as expected.
Lasse V. Karlsen