public override void connect() { base.connect(); //Starts event handler for this client/session. start_event_handler(); try { connect_response = (CommandResponse)ProtocolSend("connect"); if (!connect_response.IsSuccess()) { throw new ConnectError("Error Connecting"); } } catch (Exception ex) { throw new ConnectError("Timeout Connecting"); } // Sets channel and channel unique id from this event _channel = connect_response; _uuid = connect_response.GetHeader("Unique-ID"); //Set connected flag to True connected = true; // Sets event filter or raises ConnectError CommandResponse filter_response; if (_is_eventjson) { filter_response = (CommandResponse)EventJson(_filter); } else { filter_response = (CommandResponse)EventPlain(_filter); } if (!filter_response.IsSuccess()) { throw new ConnectError("Event filter failure"); } }
public static CommandResponse Cast(Event evnt) { CommandResponse cls = new CommandResponse(""); cls._headers = evnt._headers; cls._raw_body = evnt._raw_body; return cls; }