Package com.barchart.feed.client.provider

Examples of com.barchart.feed.client.provider.BarchartFeedReceiver


    if (args == null) {
      throw new RuntimeException("No arguments passed to main");
    }

    final BarchartFeedReceiver client = new BarchartFeedReceiver();

    final MarketInstrument[] instruments = new MarketInstrument[args.length
        - INST_START];

    for (int i = INST_START; i < args.length; i++) {
      instruments[i - INST_START] = client.lookup(args[i]);
    }

    if (args[0].equals("TCP")) {
      client.listenTCP(Integer.parseInt(args[1]), false);
    } else if (args[0].equals("UDP")) {
      client.listenUDP(Integer.parseInt(args[1]), false);
    } else {
      throw new RuntimeException("Bad protocol, expecting UDP or TCP");
    }

    client.addAllMarketsTaker(TakerFactory.makeTaker(instruments));

    System.in.read();
    client.shutdown();
    System.exit(0);

  }
View Full Code Here

TOP

Related Classes of com.barchart.feed.client.provider.BarchartFeedReceiver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.