public HttpServer(Context context, HttpConnectionCallback callback, Socket socket, bool closeOnEnd = false) { this.callback = callback; this.socket = socket; this.closeOnEnd = closeOnEnd; this.Context = context; }
public IdentClient(Context context, string server, int port) { Context = context; Server = server; Port = port; Encoding = Encoding.Default; }
/// <summary> /// Initializes a new instance of the <see cref="Manos.IO.Socket"/> class. /// </summary> /// <param name='context'> /// The context this socket will be bound to. /// </param> protected Socket(Context context) { if (context == null) throw new ArgumentNullException ("context"); this.context = context; }
public SignalWatcher(Context context, Signum signum, Action callback) : this(context, new Signum[] { signum }, (num) => { if (callback != null) { callback(); } }) { }
public Socks4Socket(Context context, string proxyHost, int proxyPort, string userId) : base(context) { Socket = context.CreateSocket(); ProxyHost = proxyHost; ProxyPort = proxyPort; UserId = userId; }
public Boundary(Context context, int maxWorkPerLoop) { asyncWatcher = context.CreateAsyncWatcher(ProcessWork); asyncWatcher.Start(); workQueue = new ConcurrentQueue<Action>(); this.maxWorkPerLoop = maxWorkPerLoop; }
Socket(Context loop, System.Net.Sockets.Socket socket) : this(loop) { this.socket = socket; this.address = ((IPEndPoint) socket.RemoteEndPoint).Address.ToString (); this.port = ((IPEndPoint) socket.RemoteEndPoint).Port; this.state = Socket.SocketState.Open; }
public IrcBot(Context context) : base(context) { DefaultPrefix = "!"; OnChannelMessage += HandleOnChannelMessage; OnQueryMessage += HandleOnQueryMessage; OnJoin += HandleOnJoin; }
public FileStream(Context loop, System.IO.FileStream stream, int blockSize) : base(loop, blockSize) { if (loop == null) throw new ArgumentNullException ("loop"); if (stream == null) throw new ArgumentNullException ("stream"); this.stream = stream; }
public ManosTwitter(Context context, OAuthTokens oauthtokens, TaskScheduler scheduler) { Context = context; TaskScheduler = scheduler; OAuthTokens = oauthtokens; callbacks = new AsyncWatcher<Action>(Context, (callback) => { callback(); }); callbacks.Start(); }
public HttpResponse(Context context, IHttpRequest request, ITcpSocket socket) : base(context) { Request = request; Socket = socket; StatusCode = 200; WriteHeaders = true; Stream = new HttpStream (this, socket.GetSocketStream ()); Stream.Chunked = (request.MajorVersion > 0 && request.MinorVersion > 0); }
public HttpRequest(Context context, string address) : base(context) { Uri uri = null; if (!Uri.TryCreate (address, UriKind.Absolute, out uri)) throw new Exception ("Invalid URI: '" + address + "'."); RemoteAddress = uri.Host; RemotePort = uri.Port; Path = uri.AbsolutePath; Method = HttpMethod.HTTP_GET; MajorVersion = 1; MinorVersion = 1; }
public static void Init(Context context) { Window.Init(); Running = true; Curses.Raw = true; Curses.Echo = false; Curses.start_color(); Curses.use_default_colors(); Window.Standard.Keypad = true; Context = context; }
public SignalWatcher(Context context, Signum[] signals, Action<Signum> callback) { Signals = signals; unixSignals = new UnixSignal[signals.Length]; for (int i = 0; i < signals.Length; i++) { unixSignals[i] = new UnixSignal(signals[i]); } watcher = new AsyncWatcher<Signum>(context, (key) => { if (callback != null) { callback(key); } }); thread = new Thread((o) => { while (true) { var index = UnixSignal.WaitAny(unixSignals); watcher.Send(Signals[index]); } }); }
public Socks4Server(Context context, Socket socket) { Context = context; Socket = socket; VersionCheck = true; }
public IdentServer(Context context) { Context = context; Encoding = Encoding.Default; }
public HttpRequest(Context context, string remote_address, int port) : this(context, remote_address) { RemotePort = port; }
public IdentClient(Context context, string server) : this(context, server, 113) { }
static AppHost() { context = Context.Create (); }
public Boundary(Context context) : this(context, 18) { }
public Socket(Context loop) : base(loop) { }
public ManosTwitter(Context context, OAuthTokens oauthtokens) : this(context, oauthtokens, TaskScheduler.Default) { }