Example usage for org.apache.commons.javaflow Continuation suspend

List of usage examples for org.apache.commons.javaflow Continuation suspend

Introduction

In this page you can find the example usage for org.apache.commons.javaflow Continuation suspend.

Prototype

public static Object suspend(final Object value) 

Source Link

Document

Stops the running continuation.

Usage

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));
}