List of usage examples for org.apache.commons.javaflow Continuation suspend
public static Object suspend(final Object value)
From source file:org.shelloid.netverif.NetVerifSocketImpl.java
@Override public void connect(SocketAddress saddr, int timeout) throws IOException { InetSocketAddress iaddr = (InetSocketAddress) saddr; System.out.println("connect: " + iaddr); if (localAddr == null) { localAddr = InetAddress.getByName(NetVerifEngine.getInstance().getCurrentHost()); }//from ww w . j av a 2 s . c om this.localport = NetVerifEngine.getInstance().getAvailablePort(localAddr.getHostAddress()); Continuation.suspend(new EventMeta(EventMeta.REASON.SOCKET_CONNECT, this, iaddr)); this.address = iaddr.getAddress(); this.port = iaddr.getPort(); }
From source file:org.shelloid.netverif.NetVerifSocketImpl.java
@Override public void accept(SocketImpl s) throws IOException { Continuation.suspend(new EventMeta(EventMeta.REASON.SOCKET_ACCEPT, this, s)); }