com.fastchar.socket.FastSocketWeb Maven / Gradle / Ivy
package com.fastchar.socket;
import com.fastchar.core.FastEngine;
import com.fastchar.interfaces.IFastWebRun;
/**
* @author 沈建(Janesen)
* @date 2021/4/19 14:01
*/
public class FastSocketWeb implements IFastWebRun {
@Override
public void onRun(FastEngine engine) throws Exception {
for (FastSocketServerConfig socketServerConfig : FastSocketServerConfig.SOCKET_SERVER_CONFIGS) {
if (socketServerConfig.isSocketAutoStart()) {
socketServerConfig.getSocketServer().start();
}
}
}
@Override
public void onInit(FastEngine engine) throws Exception {
}
@Override
public void onDestroy(FastEngine engine) throws Exception {
for (FastSocketServerConfig socketServerConfig : FastSocketServerConfig.SOCKET_SERVER_CONFIGS) {
if (socketServerConfig.isSocketAutoStart()) {
socketServerConfig.getSocketServer().stop();
}
}
}
}