java - Internal Implementation of ServerSocket.accept() method? -
everyone aware of socket programming in java. write code below: serversocket serversocket = new serversocket(1234); socket server = serversocket.accept(); we know create object of serversocket , next write serversocket.accept(); code receive client request. know serversocket.accept(); wait until new request comes. but question : serversocket.accept(); method internally? might running in while loop ? how server identify new request came serve ? internal implmentation of serversocket.accept(); method? 1 has idea this? on linux, serversocket.accept() (in native code) accept syscall (see man 2 accept ) blocks waiting suitable incoming connection. there no while loop in java code or in native code. i've no idea happens inside linux kernel, @ point no longer java question. the same apply java on windows, , c# or other programming language cared consider.