wait for next connectionconnectionaddress sockobj accept(pass to process for service print('server connected by'addressend='print('at'now()process(target=handleclientargs=(connection,)start(if __name__ ='__main__'print('parent:'os getpid()sockobj socket(af_inetsock_streamsockobj bind((myhostmyport)sockobj listen( dispatcher(make tcp socket object bind it to server port number allow pending connects this server variant is noticeably simpler too like the forking server it' derived fromthis server works fine under cygwin python on windows running as localhostand would probably work on other unix-like platforms as wellbecause multiprocessing forks process on such systemsand file and socket descriptors are inherited by child processes as usual hencethe child process uses the same connected socket as the parent here' the scene in cygwin server window and two windows client windows[server window[ :\pp \internet\sockets]python multi-server py parent server connected by ( ' at sat apr : : child server connected by ( ' at sat apr : : child [two client windowsc:\pp \internet\socketspython echo-client py client receivedb"echo=> 'hello network worldat sat apr : : :\pp \internet\socketspython echo-client py localhost brave sir robin client receivedb"echo=> 'braveat sat apr : : client receivedb"echo=> 'sirat sat apr : : client receivedb"echo=> 'robinat sat apr : : howeverthis server does not work on standard windows python--the whole point of trying to use multiprocessing in this context--because open sockets are not correctly pickled when passed as arguments into the new process here' what occurs in the server windows on windows with python :\pp \internet\socketspython multi-server py parent server connected by ( ' at sat apr : : child process process- traceback (most recent call last)file " :\python \lib\multiprocessing\process py"line in _bootstrap self run(file " :\python \lib\multiprocessing\process py"line in run self _target(*self _args**self _kwargsfile " :\pp \internet\sockets\multi-server py"line in handleclient data connection recv( till eof when socket closed network scripting