Exemplo n.º 1
0
 public void Listen(int backlog, Action <UVError> connectionCb)
 {
     Ensure.Success(Api.uv_listen(handle, backlog, (_, status) =>
     {
         connectionCb(UVError.FromStatus(status));
     }));
 }
Exemplo n.º 2
0
        public void Shutdown(Action <UVError> shutdownCb)
        {
            var req = Marshal.AllocCoTaskMem(Api.uv_req_size(ReqType.Shutdown));

            Ensure.Success(Api.uv_shutdown(req, handle, (_, status) =>
            {
                if (shutdownCb != null)
                {
                    shutdownCb(UVError.FromStatus(status));
                }
                Marshal.FreeCoTaskMem(req);
            }));
        }