Skip to content

Instantly share code, notes, and snippets.

@baldur
Created July 22, 2014 18:53
Show Gist options
  • Save baldur/c99d9e6eee566430176e to your computer and use it in GitHub Desktop.
Save baldur/c99d9e6eee566430176e to your computer and use it in GitHub Desktop.
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