How to use CassiniDev.Lib without the timeout?

2019-09-14 18:45发布

问题:

I am using the CassiniDev.Lib4 DLL and recognized that the server stops responding after a certain amount of time.

Looking at the code in CassiniServer.cs I could see that a timeout of 60 seconds is set:

_server = new Server(port, virtualPath, applicationPath, ipAddress, hostname, 60000);

How can I avoid any timeout of the server? And why is there a timeout?

EDIT: Fiddler tells me: HTTP/1.1 502 Fiddler - Connection Failed Content-Type: text/html; charset=UTF-8 Connection: close Timestamp: 09:18:38.367 The socket connection to localhost failed. Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 127.0.0.1:1278

EDIT 2: I'm not sure anymore, that it has to do with an implemented timeout, because I kept time and can't recognize a 60 seconds time window. Sometimes the server didn't respond after 40 seconds after the last click. Or could it be, that a cached website was loaded and the last click didn't trigger a request?

I am really looking forward to your hints!

Best regards,

KB

回答1:

As a quick walkaround I uncommented the code of DecrementRequestCount() and IncrementRequestCount() in Server.cs. I think there still is a bug in CassiniDev.Lib4. Cassini now seems to run properly without stopping responding.

I am sorry, that I didn't had more time to dive deeper into this, but I would appreciate any hints or fixes for this.