// whether we're primary or backup server, as well as our local and
// remote endpoints to bind and connect to:
public bstar(boolean primary, String local, String remote) {
// Initialize the Binary Star
ctx = new ZContext();
loop = new ZLoop();
state = primary? State.STATE_PRIMARY: State.STATE_BACKUP;
// Create publisher for state going to peer
statepub = ctx.createSocket(ZMQ.PUB);
statepub.bind(local);