예제 #1
0
        private static void UvConnectCb(IntPtr ptr, int status)
        {
            var req = FromIntPtr <UvConnectRequest>(ptr);

            var callback = req._callback;

            req._callback = null;

            var state = req._state;

            req._state = null;

            UvException error = null;

            if (status < 0)
            {
                req.Libuv.Check(status, out error);
            }

            try
            {
                callback(req, status, error, state);
            }
            catch (Exception ex)
            {
                req._log.LogError(0, ex, "UvConnectRequest");
                throw;
            }
        }
예제 #2
0
 public void Check(int statusCode, out UvException error)
 {
     // Note: method is explicitly small so the success case is easily inlined
     error = statusCode < 0 ? GetError(statusCode) : null;
 }
예제 #3
0
 public void ip6_addr(string ip, int port, out SockAddr addr, out UvException error)
 {
     Check(_uv_ip6_addr(ip, port, out addr), out error);
 }