IPDaemon component from nsoftware. I haven't found good example of using this control. I'm developing socket server which can accept up to 500 clients connections each client can send a lot of messages each second. When I change InBufferSize to 65536 after 20 minutes of work with 200+ clients there's stackoverflow exception. I changed to 8192 and no exception now but sometimes it stops to accept connections at all and it looks like it hangs but it's not. I can ping clients they are alive but no info about incoming/refused connections in the logs, nothing but the app looks like working. What's the best configs for IPDaemon should be to be good for these requirements? May be you know informative IPDaemon examples? Documentation doesn't help me.
Here's what I have now:
private void InitDaemon()
{
try
{
_daemon.OnConnected += OnConnected;
_daemon.OnConnectionRequest += OnConnectionRequest;
_daemon.OnDataIn += OnDataIn;
_daemon.OnDisconnected += OnDisconnected;
_daemon.OnError += OnError;
_daemon.OnSSLClientAuthentication += OnSSLClientAuthentication;
_daemon.SSLStartMode = IpdaemonSSLStartModes.sslImplicit;
_daemon.SSLAuthenticateClients = true;
// 0x00000001 Ignore time validity status of certificate. 0x00000002 Ignore time validity status of CTL.
_daemon.Config("SSLSecurityFlags=0x80000003");
_daemon.KeepAlive = true;
_daemon.LocalPort = 8082;
_daemon.DefaultMaxLineLength = 4096;
_daemon.DefaultTimeout = 60;
_daemon.DefaultEOL = "[END_OF_MESSAGE]";
_daemon.SSLCert = CertificateProviderService.GetServerCertificate();
//Add debug information about server certificate
Tools.LogDebug($"[SSLDaemonProvider]: Server certificate info {_daemon.SSLCert.ToFullInfoString()}");
//Set maximum available threads in thread pool.
_daemon.Config("MaxConnections=900");
_daemon.Config("InBufferSize=8192");
_daemon.Listening = true;
}
catch (IPWorksException ex) when (ex.Code == 223)
{
Tools.LogException(ex);
Tools.LogError(
SSLDSLocalization.DeleteCertificateManually,
Tools.SkinProvider.EECName,
CertificateProviderService.GetServerCertificate().ToFullInfoString());
}
catch (Exception ex)
{
Tools.LogException(ex);
}
}
User contributions licensed under CC BY-SA 3.0