(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Messaging / SoapTcpListener.cs
blob1dff617edbce730e012e68ed190c19a2655aa350
1 //
2 // Microsoft.Web.Services.Messaging.SoapTcpListener.cs
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
8 using System;
9 using System.Net;
10 using System.Net.Sockets;
12 namespace Microsoft.Web.Services.Messaging
14 public class SoapTcpListener : TcpListener
17 private int _refs = 0;
19 private delegate Socket AcceptSock ();
21 private AcceptSock _acceptSocket;
23 public SoapTcpListener (IPEndPoint endpoint) : base (endpoint)
25 if(Server == null) {
26 Server.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, true);
30 public SoapTcpListener (IPAddress address, int port) : base (address, port)
32 if(Server == null) {
33 Server.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, true);
37 public SoapTcpListener (int port) : base (port)
39 if(Server == null) {
40 Server.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, true);
44 public void AddReference ()
46 _refs++;
49 public int ReleaseReference ()
51 return --_refs;
54 public IAsyncResult BeginAcceptSocket (AsyncCallback callback, object state)
56 if(_acceptSocket == null) {
57 _acceptSocket = new AcceptSock (base.AcceptSocket);
59 return _acceptSocket.BeginInvoke (callback, state);
62 public Socket EndAcceptSocket (IAsyncResult result)
64 return _acceptSocket.EndInvoke (result);
67 public bool IsListening {
68 get { return Active; }