0

In my bluetooth application i am trying to read my bluetooth sockets's stream. but i am not able to set readtimeout. stream.Readtimeout always throws exception.I am able to read and write througn that stream but could not set read timeout. The following is the part of my code

NetworkStream stream;
stream = sp_sock.GetStream();//where sp_sock is my BluetoothClient
stream.ReadTimeout = 1000;

Exception that i get is :

System.InvalidOperationException:Timeout are not supported on this stream

Application was built to run on windows ce 6.0 machine. Why is there no suport for timeout for this stream? Should in have to use another stream other than networkstream?Is there any way to overcome this?

subbu147
  • 346
  • 1
  • 9

1 Answers1

0

Timeouts aren't supported on WinCe sockets (if I remember correctly) and thus there's no support for timeouts on NETCF's NetworkStream either.

Have a look instead at class InTheHand.Net.Bluetooth.Factory.TimeoutDecorStream in the 32feet.NET source code.

alanjmcf
  • 3,430
  • 1
  • 17
  • 14