示例#1
0
        /// <inheritdoc />
        protected override void Dispose(bool disposed)
        {
            var endPoints = this.LocalEndpoints;

            base.Dispose(disposed);

            if (endPoints == null || endPoints.Count == 0)
            {
                return;
            }

            foreach (var endPoint in endPoints)
            {
                try
                {
                    var fileName = UnixSocketTransport.GetEndPointFileName(endPoint);
                    if (File.Exists(fileName))
                    {
                        File.Delete(fileName);
                    }
                }
                catch (Exception webSocketFileDeleteError) when(webSocketFileDeleteError is ThreadAbortException == false)
                {
                    /* ignore delete exception */
                }
            }
        }
示例#2
0
 /// <inheritdoc />
 public UnixSocketListener(UnixSocketTransport transport, EndPoint[] endPointsToListen, WebSocketListenerOptions options)
     : base(transport, endPointsToListen, ProtocolType.Unspecified, options)
 {
     this.transport = transport;
 }