public virtual int GetInt32(string name) { var value = default(int); DefaultInvoker.InvokeWithDefaultErrorHandling(() => _getInt32(name, ref value)); return(value); }
public virtual double GetTotalMilliseconds(string name) { var value = default(int); DefaultInvoker.InvokeWithDefaultErrorHandling(() => _getDurationMilliseconds(name, ref value)); return(value); }
public virtual ulong GetSize(string name) { var value = default(ulong); DefaultInvoker.InvokeWithDefaultErrorHandling(() => _getUInt64(name, ref value)); return(value); }
public void Dial(string addr, Dialer d, SocketFlag flags = None) { var did = default(uint); DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Dial(_sid, addr, ref did, (int)flags)); d?.OnDialed(did); }
public void Listen(string addr, Listener l, SocketFlag flags = None) { var lid = default(uint); DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Listen(_sid, addr, ref lid, (int)flags)); l?.OnListened(lid); }
public virtual bool TryReceive(Message message, SocketFlag flags = None) { var msgPtr = IntPtr.Zero; DefaultInvoker.InvokeWithDefaultErrorHandling(() => __ReceiveMessage(_sid, out msgPtr, (int)flags)); message.RetainPtr(msgPtr); return(message.HasOne); }
public virtual void Start(SocketFlag flags = None) { if (HasOne) { return; } DefaultInvoker.InvokeWithDefaultErrorHandling(() => _start((int)flags)); }
public virtual void Close() { if (!HasOne) { return; } DefaultInvoker.InvokeWithDefaultErrorHandling(() => _close()); }
public virtual bool TryReceive(ICollection <byte> buffer, ref int count, SocketFlag flags = None) { var local = new byte[count]; var sz = (ulong)count; DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Receive(_sid, local, ref sz, (int)flags)); buffer.AddRange(local.Take(count = (int)sz)); return(sz > 0); }
public void Close() { if (!HasOne) { return; } DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Close(_sid)); Configure(_sid = 0); }
public virtual string GetText(string name, ref ulong length) { var sz = length; var sb = new StringBuilder((int)length); DefaultInvoker.InvokeWithDefaultErrorHandling(() => _getStringBuilder(name, sb, ref sz)); var s = sb.ToString().Trim(); length = (ulong)s.LongCount(); return(s); }
public virtual void Send(Message message, SocketFlag flags = None) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => __SendMessage(_sid, message.CedePtr(), (int)flags)); }
protected Socket(OpenDelegate open) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => open(ref _sid)); Options = PrivateOptions = new OptionReaderWriter(); Configure(_sid); }
public virtual void SetSize(string name, ulong sz) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => _setUInt64(name, sz)); }
public virtual void SetTotalMilliseconds(string name, int value) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => _setDurationMilliseconds(name, value)); }
public virtual void SetInt32(string name, int value) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => _setInt32(name, value)); }
public virtual void SetString(string name, string s) { var sz = (ulong)s.Length; DefaultInvoker.InvokeWithDefaultErrorHandling(() => _setString(name, s, sz)); }
public virtual void Send(IEnumerable <byte> bytes, long count, SocketFlag flags = None) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Send(_sid , bytes.ToArray(), (ulong)count, (int)flags)); }
public virtual void Send(string s, int length, SocketFlag flags = None) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Send(_sid , new StringBuilder(s), (ulong)length, (int)flags)); }
public Listener(Socket s, string addr) { DefaultInvoker.InvokeWithDefaultErrorHandling(() => __Create(ref _lid, s.Id, addr)); Configure(_lid); }