After the handshake when I am on a secure socket I get always the
following exception: "A blocking operation is currently executing"
I use only asynchronous Read and Write operations. But it looks like the
secure socket API of Windows Mobile supports only 1 operation at a time,
even when using async operations.
This is not good because I am working on an asynchronous protocol and
must be able to receive and send data at any time. It no request
response protocol like HTTP, POP3 and others.
As a workaround I tried to setup a receiver thread with a loop where I
check whether data is available or not before calling BeginReceive. But
this does not work either because socket.Available and FIONREAD both
return always 0, even if data is available in the buffer for reading.
How can I implement asynchronous protocols with the secure socket api?
Any help and pointers are appreciated.
Thanks,
Alex
Paul T.
"Alexander Gnauck" wrote:
> .
>
the problem is the receive thread. This thread also calls Receive when
no data is available on the socket. The receive call blocks then until
data was received. While the Receive is blocked I can't call send
because it raised an exception when the socket is SSL or TLS.
Alex
Paul T.
"Alexander Gnauck" wrote:
> .
>
Thanks Paul. The select() works perfect on the SSL socket.
I tried lots of other managed and low level functions before to verify
that I can read on the socket which did not work. Its messy, but works
perfect. I can live with this hack and still hope that the SslStream
class will be available in the next version of the compact framework.
Alex
I'm with you 100% on that. SslStream is dead easy to use by comparison with
raw WinSock.
Paul T.
While I don't have experience with the native WinCE SSL sockets, I'd
like to point you to http://www.bouncycastle.org/csharp/ which
contains a completely managed implementation of TLS, compatible
with .NET and .NET CF.