This commit is contained in:
Administrator
2024-08-18 17:47:11 +08:00
parent e4f4c77c19
commit e243203535
121 changed files with 7499 additions and 2169 deletions
@@ -0,0 +1,37 @@
package org.kne.cloud.network;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;
public class DefaultServerSocketChannelFactory extends ServerSocketChannelFactory {
@Override
public ServerSocketChannel createServerSocketChannel() throws IOException {
return ServerSocketChannel.open();
}
@Override
public ServerSocketChannel createServerSocketChannel(int port) throws IOException {
ServerSocketChannel ssc=ServerSocketChannel.open();
ssc.bind(new InetSocketAddress(port));
return ssc;
}
@Override
public ServerSocketChannel createServerSocketChannel(int port, int backlog) throws IOException {
ServerSocketChannel ssc=ServerSocketChannel.open();
ssc.bind(new InetSocketAddress(port),backlog);
return ssc;
}
@Override
public ServerSocketChannel createServerSocketChannel(int port, int backlog, InetAddress ifAddress)
throws IOException {
ServerSocketChannel ssc=ServerSocketChannel.open();
ssc.bind(new InetSocketAddress(ifAddress,port),backlog);
return ssc;
}
}