Search in sources :

Example 1 with StartReceiveMessage

use of jp.ossc.nimbus.service.publish.tcp.StartReceiveMessage in project nimbus by nimbus-org.

the class ClientConnectionImpl method startReceive.

private void startReceive(long from, boolean isRestart) throws MessageSendException {
    if (socket == null) {
        throw new MessageSendException("Not connected.");
    }
    if (!isRestart && isStartReceive) {
        return;
    }
    try {
        isStartReceive = true;
        send(new StartReceiveMessage(from), isAcknowledge);
    } catch (SocketTimeoutException e) {
        isStartReceive = false;
        throw new MessageSendException(e);
    } catch (SocketException e) {
        isStartReceive = false;
        throw new MessageSendException(e);
    } catch (IOException e) {
        isStartReceive = false;
        throw new MessageSendException(e);
    } catch (ClassNotFoundException e) {
        isStartReceive = false;
        throw new MessageSendException(e);
    }
}
Also used : SocketException(java.net.SocketException) StartReceiveMessage(jp.ossc.nimbus.service.publish.tcp.StartReceiveMessage) MessageSendException(jp.ossc.nimbus.service.publish.MessageSendException) SocketTimeoutException(java.net.SocketTimeoutException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 SocketException (java.net.SocketException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 MessageSendException (jp.ossc.nimbus.service.publish.MessageSendException)1 StartReceiveMessage (jp.ossc.nimbus.service.publish.tcp.StartReceiveMessage)1