using like "select" function

niros

Member
Joined
May 25, 2004
Messages
23
Hi, I am familiar with the select function from c++.
I wanted to know if someone knows a way to listen to a socket for example with a something like the select function (that has a timeout as well).
I need to receive unknown sized data from a socket in a non-blocking way , Therefore I am not sure that using "Socket.BeginReceive" is the best solution for me, because I will want to receive each time one byte because I don
 
Have you tried setting the timeout for receiving?
Code:
//Receive operations will timeout if not received within 1000 milliseconds.
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 1000);
Note, I havent tried it, as I usually use asynchronous methods, but it should block for one second.
 

Similar threads

P
Replies
0
Views
176
Policy standard local admin account with Active Di
P
Back
Top