public override void SetLength(long value) { Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("ListenerRequestStream#" + HttpTraceHelper.HashString(this) + "::Seek() throwing: " + exception.ToString()); } #endif throw exception; }
public override void Write(byte[] buffer, int offset, int count) { #if DEBUG if (HttpTraceHelper.InternalLog.TraceVerbose) { HttpTraceHelper.WriteLine("ListenerRequestStream#" + HttpTraceHelper.HashString(this) + "::Write()"); } #endif Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("ListenerRequestStream#" + HttpTraceHelper.HashString(this) + "::Write() throwing: " + exception.ToString()); } #endif throw exception; }
public override long Seek(long offset, SeekOrigin origin) { Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("ListenerResponseStream#" + HttpTraceHelper.HashString(this) + "::Seek() throwing: " + exception.ToString()); } #endif throw exception; }
public override int Read(byte[] buffer, int offset, int count) { #if DEBUG if (HttpTraceHelper.Api.TraceVerbose) { HttpTraceHelper.WriteLine("HttpListenerWebResponse#" + HttpTraceHelper.HashString(this) + "::Read()"); } #endif Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("ListenerResponseStream#" + HttpTraceHelper.HashString(this) + "::Read() throwing: " + exception.ToString()); } #endif throw exception; }
// // if a request comes in for a Uri that doesn't match // the current set of Registered prefixes we return // an error and close the connection on the client // private bool CanServe(Uri uri) { if (m_PrefixFiltering) { Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("HttpWebListener#" + HttpTraceHelper.HashString(this) + "::CanServe() throwing: " + exception.ToString()); } #endif throw exception; } return true; }
public void Start(IPEndPoint ipEndPoint, bool prefixFiltering) { #if DEBUG if (HttpTraceHelper.Api.TraceVerbose) { HttpTraceHelper.WriteLine("HttpWebListener#" + HttpTraceHelper.HashString(this) + "::Start() ipEndPoint:" + ipEndPoint.ToString() + " prefixFiltering:" + prefixFiltering.ToString() ); } #endif if (m_PrefixFiltering) { Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("HttpWebListener#" + HttpTraceHelper.HashString(this) + "::Start() throwing: " + exception.ToString()); } #endif throw exception; } m_IPEndPoint = ipEndPoint; m_Timeout = System.Threading.Timeout.Infinite; m_RequestReady.Reset(); m_PrefixFiltering = prefixFiltering; m_AccepterSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // this might throw if the address is already in use m_AccepterSocket.Bind(m_IPEndPoint); m_AccepterSocket.Listen((int)SocketOptionName.MaxConnections); m_AccepterSocket.BeginAccept(staticAcceptCallback, this); }
public void RemoveUriPrefix(Uri uriPrefix) { #if DEBUG if (HttpTraceHelper.Api.TraceVerbose) { HttpTraceHelper.WriteLine("HttpWebListener#" + HttpTraceHelper.HashString(this) + "::RemoveUriPrefix() uriPrefix:" + uriPrefix.ToString()); } #endif if (m_PrefixFiltering) { Exception exception = new NotSupportedException(); #if DEBUG if (HttpTraceHelper.ExceptionThrown.TraceVerbose) { HttpTraceHelper.WriteLine("HttpWebListener#" + HttpTraceHelper.HashString(this) + "::RemoveUriPrefix() throwing: " + exception.ToString()); } #endif throw exception; } }