Ejemplo n.º 1
0
        public static int SetOpt <T>(this ISetOptions socket, string name, T data)
        {
            switch (data)
            {
            case bool value:
                return(socket.SetOpt(name, value));

            case int value:
                return(socket.SetOpt(name, value));

            case nng_duration value:
                return(socket.SetOpt(name, value));

            case IntPtr value:
                return(socket.SetOpt(name, value));

            case UIntPtr value:
                return(socket.SetOpt(name, value));

            case string value:
                return(socket.SetOpt(name, value));

            case UInt64 value:
                return(socket.SetOpt(name, value));
            }
            return(Defines.NNG_EINVAL);
        }
Ejemplo n.º 2
0
        public static int SetOpt <T>(this ISetOptions socket, string name, T data)
        {
            switch (data)
            {
            case bool boolVal:
                return(socket.SetOpt(name, boolVal));

            case int intVal:
                return(socket.SetOpt(name, intVal));

            case nng_duration durVal:
                return(socket.SetOpt(name, durVal));

            case UIntPtr sizeVal:
                return(socket.SetOpt(name, sizeVal));
            }
            return(Defines.NNG_EINVAL);
        }