by Michele Baravalle [ooly at interfree dot it] posted on 2005/02/21 |
|
I'm add ssl functionality on CassiniEx problem but i've a problem...
The source
private int waitForRequestBytes() {
int availBytes = 0;
// Server.Logger.Debug("bhooo" + _socket.Available);
try {
if (_socket.Available == 0) {
// poll until there is data
Server.Logger.Debug("1a");
_socket.Poll(100000 /* 100ms */, SelectMode.SelectRead);
Server.Logger.Debug("1b");
if (_socket.Available == 0 && _socket.Connected)
_socket.Poll(10000000 /* 10sec */, SelectMode.SelectRead);
}
Server.Logger.Debug("1c");
availBytes = _socket.Available;
}
catch {
}
return availBytes;
}
work well without ssl but crash with the ssl support.
Any idea?
Thanks
Michele |
by thomas [sunyunzju at sohu dot com] posted on 2005/03/24 |
|
I have met the same problem,I add ssl function to Cassini
...
private int WaitForRequestBytes() {
int availBytes = 0;
try {
if(_socket.Available == 0 ) {
// poll until there is data
_socket.Poll(100000 /* 100ms */, SelectMode.SelectRead);
if (_socket.Available == 0 && _socket.Connected)
_socket.Poll(10000000 /* 10sec */, SelectMode.SelectRead);
}
availBytes = _socket.Available;
}
catch(Exception e) {
throw new Exception(e.Message);
}
return availBytes;
}
work well without ssl but crash with the ssl support.
I read the source code,I found
in the file SecureSocket.cs,the function Poll throw new NotSupportedException("The Poll method is not supported in SSL or TLS mode. Use the asynchronous methods and the Available property instead.");
I have read your solution,but It can't work. do you have any idea to resolve this problem?
thanks
|