Created
October 19, 2012 03:20
-
-
Save johndemic/3916048 to your computer and use it in GitHub Desktop.
StockQuoteRequestClient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StockQuoteRequest stockQuoteRequest = new StockQuoteRequest(); | |
stockQuoteRequest.setSymbol("FB"); | |
stockQuoteRequest.setStartDate(new Date( new Date().getTime() - (86400000 * 7))); | |
stockQuoteRequest.setEndDate(new Date()); | |
ZMQ.Socket zmqSocket = zmqContext.socket(ZMQ.REQ); | |
zmqSocket.setReceiveTimeOut(RECEIVE_TIMEOUT); | |
zmqSocket.connect("tcp://localhost:9090"); | |
zmqSocket.send(stockQuoteRequest.toProtocolBufferAsBytes(), 0); | |
List<StockQuote> quotes = StockQuote.listOfStockQuotesFromBytes(zmqSocket.recv(0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment