by Raj posted on 2006/02/27 |
|
Sometimes SecureSocket caches the receive data.
Here is my case:
[I am using Async calls on Secure socket]
I have my main application thread, and a separate thread to write the data to my server. My main application thread starts the receving by calling (secureSocket.BeginRecieve), and call returns. When the data is available, it is suppose to be processed in the callback method, which will be executed in a separate thread.
This process is wroking very well, but I have a case where it fails.
In my main application thread, I made two calls to the server, where I don't need the response immediately, but other call do require. so, I sent an unique ID with the call (so server can echo it), first call will write to the server and returns immediately, and second call will write to the server and blocks on the main thread by calling IAsyncResult.WaitOne(). So, when the data is received, it will be processed properly based on my unique, and waitOne() will be released.
But, if I run the above case in a big loop, sometimes, securesockets doesn't spit the data eventhough my server wrote to the socket.
TO made to my above comment, what I did is, I wrote more data, and server received the call and sent the response back, now secureSocket is send the old cached data ...
So, I am confused .. may I know where thr problem is?.
I tried my situation with Dart PowerTCP, and it worked fine. |