Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove register/unregister socket code.

  • Loading branch information...
commit 8b39012006273c1916f7bd1e1930899f85fc5370 1 parent 9c3b7f8
@gonzalop gonzalop authored
View
7 src/Mono.WebServer.XSP/XSPWorker.cs
@@ -239,13 +239,6 @@ public void Close (bool keepAlive)
} catch {
// ignore
}
-
- try {
- server.UnregisterSocket (sock);
- } catch {
- // ignore
- }
-
try {
sock.Close ();
} catch {
View
57 src/Mono.WebServer/ApplicationServer.cs
@@ -84,8 +84,6 @@ namespace Mono.WebServer
public class ApplicationServer : MarshalByRefObject
{
- static readonly object registeredSocketsLock = new object ();
-
WebSource webSource;
bool started;
bool stop;
@@ -98,8 +96,6 @@ public class ApplicationServer : MarshalByRefObject
Thread runner;
- Dictionary <Socket, bool> registeredSockets;
-
// This is much faster than hashtable for typical cases.
ArrayList vpathToHost = new ArrayList ();
@@ -359,30 +355,6 @@ public void ShutdownSockets ()
listen_socket = null;
}
}
-
- lock (registeredSocketsLock) {
- if (registeredSockets == null)
- return;
-
- shuttingDown = true;
- foreach (Socket s in registeredSockets.Keys) {
- if (s == null)
- continue;
-
- try {
- if (s.Connected)
- s.Shutdown (SocketShutdown.Both);
- } catch {
- // ignore - we don't care, we're closing anyway
- }
-
- try {
- s.Close ();
- } catch {
- // ignore
- }
- }
- }
}
void RealStop ()
@@ -402,34 +374,6 @@ public void UnloadAll ()
}
}
- public void RegisterSocket (Socket socket)
- {
- lock (registeredSocketsLock) {
- if (registeredSockets == null) {
- registeredSockets = new Dictionary <Socket, bool> ();
- registeredSockets.Add (socket, true);
-
- return;
- }
-
- if (registeredSockets.ContainsKey (socket))
- return;
-
- registeredSockets.Add (socket, true);
- }
- }
-
- public void UnregisterSocket (Socket socket)
- {
- lock (registeredSocketsLock) {
- if (registeredSockets == null || shuttingDown)
- return;
-
- if (registeredSockets.ContainsKey (socket))
- registeredSockets.Remove (socket);
- }
- }
-
void SetSocketOptions (Socket sock)
{
@@ -484,7 +428,6 @@ void OnAccept (object sender, EventArgs e)
accepted.Blocking = true;
SetSocketOptions (accepted);
- RegisterSocket (accepted);
StartRequest (accepted, 0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.