Ejemplo n.º 1
0
    public void MergeFrom(MessageFromClient other)
    {
        if (other == null)
        {
            return;
        }
        if (other.ClientType != 0)
        {
            ClientType = other.ClientType;
        }
        switch (other.MessageCase)
        {
        case MessageOneofCase.ArduinoAction:
            if (ArduinoAction == null)
            {
                ArduinoAction = new global::ArduinoAction();
            }
            ArduinoAction.MergeFrom(other.ArduinoAction);
            break;

        case MessageOneofCase.WebClientAction:
            if (WebClientAction == null)
            {
                WebClientAction = new global::WebClientAction();
            }
            WebClientAction.MergeFrom(other.WebClientAction);
            break;
        }

        _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }
Ejemplo n.º 2
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (ClientType != 0)
        {
            hash ^= ClientType.GetHashCode();
        }
        if (messageCase_ == MessageOneofCase.ArduinoAction)
        {
            hash ^= ArduinoAction.GetHashCode();
        }
        if (messageCase_ == MessageOneofCase.WebClientAction)
        {
            hash ^= WebClientAction.GetHashCode();
        }
        hash ^= (int)messageCase_;
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
Ejemplo n.º 3
0
        public static void PerformWebClientAction(WebClientAction webClientAction, WebRequestAction webRequestAction = null, bool forceSsl3 = false)
        {
            if (!forceSsl3)
            {
                try
                {
                    using (ExtendedWebClient client = new ExtendedWebClient(webRequestAction))
                    {
                        webClientAction(client);
                    }
                }
                catch (WebException ex)
                {
                    log.Error(ex.GetType().Name + ": " + ex.Message + " (" + ex.Status + ") -> Retry with SSL3");
                }
            }

            // now try using ssl3:
            // http://poweredbydotnet.blogspot.de/2012/03/solving-received-unexpected-eof-or-0.html
            SecurityProtocolType oldType = ServicePointManager.SecurityProtocol;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
            try
            {
                using (ExtendedWebClient client = new ExtendedWebClient(webRequestAction))
                {
                    webClientAction(client);
                    ServicePointManager.SecurityProtocol = oldType;
                }
            }
            catch
            {
                ServicePointManager.SecurityProtocol = oldType;
                throw;
            }
        }
 private void HandleClientMessage(WebClientAction messageWebClientAction)
 {
     throw new NotImplementedException();
 }