Exemplo n.º 1
0
        public static void Main()
        {
            // TODO:// replace with your app details and Betfair username/password
            BetfairClient client = new("APPKEY");

            client.Login(@"client-2048.p12", "certpass", "username", "password");

            // Exchange Streaming API example, see: http://docs.developer.betfair.com/docs/display/1smk3cen4v3lu3yomq5qye0ni/Exchange+Stream+API
            // TODO:// replace with your app deatils and Betfair username/password, and enable streaming support on your Betfair account
            //StreamingBetfairClient streamingClient = new StreamingBetfairClient("stream-api-integration.betfair.com", "APPKEY");
            //streamingClient.Login("username", "password");

            /*
             * OriginalExample runs the code originally in here, using the standard MarketListener
             * PeriodicExample runs a version of MarketListener (MarketListenerPeriodic), using an RX interval, specified in seconds
             * MultiPeriodExample runs a version of MarketListenerPeriodic (MarketListenerMultiPeriod), using potentially differing poll intervals per market book
             */

            var example = new OriginalExample(client); // This example blocks within GO

            //var example = new StreamingExample(client, streamingClient); // Betfair Exchange Streaming API example
            //var example = new PeriodicExample(client, 0.5);
            //var example = new MultiPeriodExample(client);
            example.Go();

            if (!OriginalExample.IsBlocking)
            {
                Thread.Sleep(TimeSpan.FromMinutes(20));
            }

            Console.WriteLine("done.");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        public static void Main()
        {
            BetfairClient client;

            //TODO: see chat re TLS1.0 vs 2.0 bug + urls: #FRAMEWORK?
            if (File.Exists("App.config"))
            {
                client = new BetfairClient(ConfigurationManager.AppSettings["bfAppKey"]);
                client.Login(ConfigurationManager.AppSettings["logOnCertFile"],
                             SecureStringManager.Unprotect("logOnCertFilePassword", true),
                             SecureStringManager.Unprotect("bfUsername", true),
                             SecureStringManager.Unprotect("bfPassword", true));
            }
            else
            {
                // TODO:// replace with your app details and Betfair username/password
                client = new BetfairClient("APPKEY");
                client.Login(@"client-2048.p12", "certpass", "username", "password");
            }

            /*
             * OriginalExample runs the code originally in here, using the standard MarketListener
             * PeriodicExample runs a version of MarketListener (MarketListenerPeriodic), using an RX interval, specified in seconds
             * MultiPeriodExample runs a version of MarketListenerPeriodic (MarketListenerMultiPeriod), using potentially differing poll intervals per market book
             */

            var example = new OriginalExample(client); // This example blocks within GO

            //var example = new StreamingExample(client, streamingClient); // Betfair Exchange Streaming API example
            //var example = new PeriodicExample(client, 0.5);
            //var example = new MultiPeriodExample(client);
            example.Go();

            if (!example.IsBlocking)
            {
                Thread.Sleep(TimeSpan.FromMinutes(20));
            }

            Console.WriteLine("done.");
            Console.ReadLine();
        }