2004-09-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* server/ApplicationServer.cs: make the server socket non-blocking and
	ignore any exception on Accept.

svn path=/trunk/xsp/; revision=33779
This commit is contained in:
Gonzalo Paniagua Javier 2004-09-12 19:38:40 +00:00
Родитель f13ef99994
Коммит e88820ce99
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2004-09-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* server/ApplicationServer.cs: make the server socket non-blocking and
ignore any exception on Accept.
2004-09-12 Ben Maurer <bmaurer@ximian.com>
* server/server.cs: allow for clean exit (workaround)

Просмотреть файл

@ -232,6 +232,7 @@ namespace Mono.ASPNET
listen_socket = webSource.CreateSocket ();
listen_socket.Listen (500);
listen_socket.Blocking = false;
runner = new Thread (new ThreadStart (RunServer));
runner.IsBackground = bgThread;
runner.Start ();
@ -285,7 +286,11 @@ namespace Mono.ASPNET
for (int i = 0; i < w; i++) {
Socket s = (Socket) wSockets [i];
if (s == listen_socket) {
client = s.Accept ();
try {
client = s.Accept ();
} catch (Exception e) {
continue;
}
WebTrace.WriteLine ("Accepted connection.");
SetSocketOptions (client);
allSockets.Add (client);