зеркало из https://github.com/mono/xsp.git
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:
Родитель
f13ef99994
Коммит
e88820ce99
|
@ -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>
|
2004-09-12 Ben Maurer <bmaurer@ximian.com>
|
||||||
|
|
||||||
* server/server.cs: allow for clean exit (workaround)
|
* server/server.cs: allow for clean exit (workaround)
|
||||||
|
|
|
@ -232,6 +232,7 @@ namespace Mono.ASPNET
|
||||||
|
|
||||||
listen_socket = webSource.CreateSocket ();
|
listen_socket = webSource.CreateSocket ();
|
||||||
listen_socket.Listen (500);
|
listen_socket.Listen (500);
|
||||||
|
listen_socket.Blocking = false;
|
||||||
runner = new Thread (new ThreadStart (RunServer));
|
runner = new Thread (new ThreadStart (RunServer));
|
||||||
runner.IsBackground = bgThread;
|
runner.IsBackground = bgThread;
|
||||||
runner.Start ();
|
runner.Start ();
|
||||||
|
@ -285,7 +286,11 @@ namespace Mono.ASPNET
|
||||||
for (int i = 0; i < w; i++) {
|
for (int i = 0; i < w; i++) {
|
||||||
Socket s = (Socket) wSockets [i];
|
Socket s = (Socket) wSockets [i];
|
||||||
if (s == listen_socket) {
|
if (s == listen_socket) {
|
||||||
client = s.Accept ();
|
try {
|
||||||
|
client = s.Accept ();
|
||||||
|
} catch (Exception e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
WebTrace.WriteLine ("Accepted connection.");
|
WebTrace.WriteLine ("Accepted connection.");
|
||||||
SetSocketOptions (client);
|
SetSocketOptions (client);
|
||||||
allSockets.Add (client);
|
allSockets.Add (client);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче