public void Reply(SocksReply reply) { reply.ThrowIfNull <SocksReply>("reply"); this.AssertValid(); byte[] buffer = reply.Serialize(); this.stream.Write(buffer, 0, buffer.Length); }
/// <summary> /// Sends the specified SOCKS5 reply to the connected client. /// </summary> /// <param name="reply">The SOCKS5 reply to send to the connected /// client.</param> /// <exception cref="ArgumentNullException">The reply parameter is /// null.</exception> /// <exception cref="ObjectDisposedException">The object has been /// disposed.</exception> public void Reply(SocksReply reply) { reply.ThrowIfNull("reply"); AssertValid(); var bytes = reply.Serialize(); stream.Write(bytes, 0, bytes.Length); }