This project has moved. For the latest updates, please go here.
1
Vote

HttpServer SSL

description

Hi,
I'm using the HTTPServer class on hardware Fez Cobra II.
In SSL work fine, but I get many exceptions and result to slow, I am attaching a log of calls.
It 's normal?

thanks
Luca

The thread '<No Name>' (0x3) has exited with code 0 (0x0).

Exception System.Net.Sockets.SocketException - CLR_E_FAIL (9)

Message:

Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000]

Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045]

Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d]

Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008]

MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be]

SocketException ErrorCode = 5

SocketException ErrorCode = 5

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.Security.dll

Exception System.Net.Sockets.SocketException - CLR_E_FAIL (10)

Message:

Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000]

Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045]

Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d]

Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008]

MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be]

SocketException ErrorCode = 5

SocketException ErrorCode = 5

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.Security.dll

SocketException ErrorCode = 5

SocketException ErrorCode = 5

SocketException ErrorCode = 5

SocketException ErrorCode = 5

SocketException ErrorCode = 5

SocketException ErrorCode = 5

3 worker threads (0.0.0.0:81)

SocketException ErrorCode = 5

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.Security.dll

SocketException ErrorCode = 5

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.Security.dll

SocketException ErrorCode = 5

SocketException ErrorCode = 5

SocketException ErrorCode = 5

The thread '<No Name>' (0x9) has exited with code 0 (0x0).
2 worker threads (0.0.0.0:81)

SocketException ErrorCode = 5

The thread '<No Name>' (0xa) has exited with code 0 (0x0).
ProcessRequest: Request /
The thread '<No Name>' (0xb) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /LoginPage
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread '<No Name>' (0xc) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)

Exception System.Net.Sockets.SocketException - CLR_E_FAIL (13)

Message:

Microsoft.SPOT.Net.Security.SslNative::SecureRead [IP: 0000]

Microsoft.SPOT.Net.Security.SslStream::Read [IP: 0040]

MFToolkit.Net.Web.HttpRequest::Read [IP: 0066]

MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 0107]

SocketException ErrorCode = 10060

SocketException ErrorCode = 10060

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.Security.dll

SocketException ErrorCode = 10060

SocketException ErrorCode = 10060

1 worker threads (0.0.0.0:81)
The thread '<No Name>' (0xd) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /LoginPage
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread '<No Name>' (0xe) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /Default
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread '<No Name>' (0xf) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
2 worker threads (0.0.0.0:81)
ProcessRequest: Request /home.html
2 worker threads (0.0.0.0:81)
ProcessRequest: Request /js/menu-verticale.js
The thread '<No Name>' (0x10) has exited with code 0 (0x0).
The thread '<No Name>' (0x11) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
2 worker threads (0.0.0.0:81)
3 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
ProcessRequest: Request /services/GetAuxOutList.lsx
ProcessRequest: Request /services/GetBreakdownList.lsx
ProcessRequest: Request /services/GetAreaList.lsx
ProcessRequest: Request /services/GetSabotageList.lsx
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)

comments

luca_santoro wrote Oct 19, 2013 at 4:41 PM

I modified the source code of the class httpserver and now seems to work better, no exception timeout (10060).

_listenSocket.SendTimeout = 20000;
_listenSocket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 20000);
_listenSocket.SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true);