All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payneteasy.socketio.SocketIoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.0-8
Show newest version
package com.payneteasy.socketio;

/**
 *
 */
public class SocketIoConfiguration implements ISocketIoConfiguration {

    final long handshakeConnectionTimeout;
    final long handshakeReadTimeout;

    private SocketIoConfiguration(Builder aBuilder){
        handshakeConnectionTimeout = aBuilder.theHandshakeConnectionTimeout;
        handshakeReadTimeout = aBuilder.theHandshakeReadTimeout;
    }

    @Override
    public long getHandshakeConnectionTimeout() {
        return handshakeConnectionTimeout;
    }

    @Override
    public long getHandshakeReadTimeout() {
        return handshakeReadTimeout;
    }

    public static SocketIoConfiguration getDefault() {
        return new Builder()
                .handshakeConnectionTimeout(120 * 1000)
                .handshakeReadTimeout(120 * 1000)
                .build();
    }

    public static class Builder {

        public Builder handshakeConnectionTimeout(long aHandshakeConnectionTimeout) {
            theHandshakeConnectionTimeout = aHandshakeConnectionTimeout;
            return this;
        }

        public Builder handshakeReadTimeout(long aHandshakeReadTimeout) {
            theHandshakeReadTimeout = aHandshakeReadTimeout;
            return this;
        }

        public SocketIoConfiguration build() {
            return new SocketIoConfiguration(this);
        }

        private long theHandshakeConnectionTimeout;
        private long theHandshakeReadTimeout;

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy