
com.joe.easysocket.server.common.spi.ConnectionState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of socket-common Show documentation
Show all versions of socket-common Show documentation
socket框架,方便快速开发socket服务端和客户端
The newest version!
package com.joe.easysocket.server.common.spi;
/**
* @author joe
*/
public enum ConnectionState {
/**
* 客户端连接成功
*/
CONNECTED {
public boolean isConnected() {
return true;
}
},
/**
* 客户端被挂起
*/
SUSPENDED {
public boolean isConnected() {
return false;
}
},
/**
* 客户端重连
*/
RECONNECTED {
public boolean isConnected() {
return true;
}
},
/**
* 客户端连接丢失
*/
LOST {
public boolean isConnected() {
return false;
}
},
/**
* 客户端被设置为只读状态
*/
READ_ONLY {
public boolean isConnected() {
return true;
}
};
/**
* 检查当前是否连接到了服务器
*
* @return 已经连接到服务器返回true,否则返回false
*/
public abstract boolean isConnected();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy