U:RDoc::AnyMethod[iI"tcp_server_loop:EFI"Socket::tcp_server_loop;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Ycreates a TCP/IP server on _port_ and calls the block for each connection accepted. ;TI"RThe block is called with a socket and a client_address as an Addrinfo object.;To:RDoc::Markup::BlankLineo; ; [I"VIf _host_ is specified, it is used with _port_ to determine the server addresses.;T@o; ; [I"8The socket is *not* closed when the block returns. ;TI"/So application should close it explicitly.;T@o; ; [I"/This method calls the block sequentially. ;TI"PIt means that the next connection is not accepted until the block returns. ;TI"gSo concurrent mechanism, thread for example, should be used to service multiple clients at a time.;T@o; ; [ I"VNote that Addrinfo.getaddrinfo is used to determine the server socket addresses. ;TI">When Addrinfo.getaddrinfo returns two or more addresses, ;TI"(IPv4 and IPv6 address for example, ;TI"all of them are used. ;TI"HSocket.tcp_server_loop succeeds if one socket can be used at least.;T@o:RDoc::Markup::Verbatim; [I"# Sequential echo server. ;TI".# It services only one client at a time. ;TI"