Created
July 22, 2014 18:53
-
-
Save baldur/c99d9e6eee566430176e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.mapzen; | |
import com.mapzen.osrm.Route; | |
import org.junit.runner.RunWith; | |
import org.robolectric.RobolectricTestRunner; | |
import org.robolectric.annotation.Config; | |
import org.zeromq.ZMQ; | |
@Config(manifest=Config.NONE) | |
@RunWith(RobolectricTestRunner.class) | |
public class Runner { | |
public static void main(String[] args) throws Exception { | |
ZMQ.Context context = ZMQ.context(1); | |
ZMQ.Socket responder = context.socket(ZMQ.REP); | |
responder.bind("tcp://*:5555"); | |
while (!Thread.currentThread().isInterrupted()) { | |
byte[] request = responder.recv(0); | |
System.out.println("Received Hello"); | |
Route route = new Route(new String(request)); | |
responder.send(route.toString().getBytes(), 0); | |
} | |
responder.close(); | |
context.term(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment