package com.basic.security.utils; //import nanomsg.reqrep.RepSocket; //import nanomsg.reqrep.ReqSocket; // //public class JnanomsgServer { // private static String url = "tcp://0.0.0.0:7789"; // // public static void main(String[] args) { // receive(); //// send(); // } // public static void receive() { // System.out.println("JnanomsgServer.receive"); // final RepSocket socket = new RepSocket(); // socket.setRecvTimeout(-1); // socket.bind(url); // new Thread(new Runnable() { // public void run() { // while (true) { // try { // System.out.println( "received:" + socket.recvString()); // 阻塞socket,直到超时或者有响应 // Thread.sleep(1000); // socket.send("received"); // // } catch (Exception e) { // 忽略超时 //// e.printStackTrace(); // System.out.println(e.getMessage()); // } // } // } // }).start(); // } // //// private static void send() { //// final ReqSocket socket = new ReqSocket(); //// socket.connect(url); //// new Thread(new Runnable() { //// public void run() { //// while (true) { //// try { //// socket.send("hello"); //// Thread.sleep(1000); //// System.out.println( "node0:" + socket.recvString()); // 阻塞socket,直到超时或者有响应 //// } catch (InterruptedException e) { //// e.printStackTrace(); //// } catch (Exception e) { //// // e.printStackTrace(); //// } //// } //// } //// }).start(); //// } //}