先上图
图中和接受、分配连接便是Acceptor,Poller,Worker了
1. http-nio-8080-Accepter-0:
在NioEndpoint.Acceptor.run()方法里
protected class Acceptor extends AbstractEndpoint.Acceptor {
@Override
public void run() {
while (running) {
//...
try {
SocketChannel socket = null;
try {
// Accept the next incoming connection from the server
// socket
socket = serverSock.accept();
} catch (IOException ioe) {
//...
}
// Configure the socket
if (running && !paused) {
// setSocketOptions() will hand the socket off to
// an appropria