private TivoEndPoint(string address, TivoConnectionMode mode, TivoServiceProvider serviceProvider, ICertificateStore certificateStore) { if (certificateStore == null) { throw new ArgumentNullException("certificateStore"); } if (string.IsNullOrWhiteSpace(address)) { throw new ArgumentNullException("address"); } switch (serviceProvider) { case TivoServiceProvider.TivoUSA: this.rpcAppName = "Quicksilver"; this.rpcAppVersion = new Version(1, 2); break; case TivoServiceProvider.VirginMediaUK: this.rpcAppName = "com.virginmedia.quicksilvervm"; this.rpcAppVersion = new Version(2, 2); break; case TivoServiceProvider.Unknown: default: throw new ArgumentOutOfRangeException("service", "Must specify a valid service provider."); } this.serviceProvider = serviceProvider; this.certificateStore = certificateStore; this.Address = address; this.ConnectionMode = mode; }
public async Task <JObject> Connect(TivoEndPoint endPoint, IDictionary <string, object> authMessage, int authMessageSchemaVersion) { this.connectionMode = endPoint.ConnectionMode; this.headerInfo = (IMindRpcHeaderInfo)endPoint; this.sslStream = await this.networkInterface.Initialize(endPoint).ConfigureAwait(false); this.receiveSubject = new Subject <Tuple <int, JObject> >(); // Send authentication message to the TiVo. var authTask = SendRequest(authMessage, authMessageSchemaVersion); // Start listening on the socket *after* the first send operation. // This stops errors occuring on WP7 StartReceiveThread(); return(await authTask); }
public void MessageFromServer(TivoConnectionMode mode, int schemaVersion, int rpcId, string type, string message) { WriteEvent(6, mode, schemaVersion, rpcId, type, message); }
public void ServerConnectionFailure(TivoConnectionMode mode, string exceptionText) { WriteEvent(4, mode, exceptionText); }
public void ServerConnectionFailure(TivoConnectionMode mode, Exception exception) { this.ServerConnectionFailure(mode, exception.ToString()); }
public void ServerConnected(TivoConnectionMode mode, string serverAddress) { WriteEvent(3, mode, serverAddress); }
public void ClientConnectionFailure(TivoConnectionMode mode, string exceptionText) { WriteEvent(2, mode, exceptionText); }
public void ClientConnectionFailure(TivoConnectionMode mode, Exception exception) { this.ClientConnectionFailure(mode, exception.ToString()); }
public void ClientConnected(TivoConnectionMode mode, string clientAddress, string streamProperties) { WriteEvent(1, mode, clientAddress, streamProperties); }
public static byte[] EncodeRequest(TivoConnectionMode mode, int sessionId, string tsn, int rpcId, int schemaVersion, IMindRpcHeaderInfo headerInfo, string requestType, string bodyText) { string headerText = CreateHeader(sessionId, tsn, rpcId, schemaVersion, headerInfo, requestType); return(EncodeMessage(headerText, bodyText)); }