Package org.jeromq.ZMQ

Examples of org.jeromq.ZMQ.Socket


  public void activateOptions() {
        LogLog.debug("Configuring appender...");
    super.activateOptions();

    final Context context = ZMQ.context(threads);
    Socket sender;

    if (PUBSUB.equals(socketType)) {
      LogLog.debug("Setting socket type to PUB");
      sender = context.socket(ZMQ.PUB);
    }
    else if (PUSHPULL.equals(socketType))
    {
      LogLog.debug("Setting socket type to PUSH");
      sender = context.socket(ZMQ.PUSH);
    }
    else
    {
      LogLog.debug("Setting socket type to default PUB");
      sender = context.socket(ZMQ.PUB);
    }
    sender.setLinger(1);
   
    final Socket socket = sender;
   
    final String[] endpoints = endpoint.split(",");
   
    for(String ep : endpoints) {
     
      if (BINDMODE.equals(mode)) {
        LogLog.debug("Binding socket to " + ep);
        socket.bind(ep);
      }
      else if (CONNECTMODE.equals(mode))
      {
        LogLog.debug("Connecting socket to " + ep);
        socket.connect(ep);
      }
      else
      {
        LogLog.debug("Default connecting socket to " + ep);
        socket.connect(ep);
     
    }
   
    if (identity != null) {
            LogLog.debug("Setting identity to: " + identity);
      socket.setIdentity(identity.getBytes());
    }
   
    this.socket = socket;
        LogLog.debug("Finished configuring appender");
  }
View Full Code Here


    public void activateOptions() {
        super.activateOptions();

        final Context context = ZMQ.context(threads);
        Socket sender;

        sender = context.socket(ZMQ.PUB);
        sender.setLinger(1);

        final Socket socket = sender;

        socket.bind(listenAddress);
        this.socket = socket;
    }
View Full Code Here

TOP

Related Classes of org.jeromq.ZMQ.Socket

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.