tcp_select(-Term)

The purpose of tcp_select/1 is to process connection requests, return terms related to timing, and return in a round-robin fashion terms read from connected processes. Term is one of:


connected(Socket)
is returned when the server has accepted a connection request from Socket. Socket is small integer. It is a socket file descriptor (a small integer).
wakeup(Term)
is returned when the timer alarm specified in tcp_schedule_wakeup/2 was delivered (see ipc-tcp-tim-schedule_wakeup2).
user_input
is returned whenever there is input available on stdin and tcp_watch_user(_,on) has been called. See tcp_watch_user/2, ipc-tcp-utc-watch_user2.
term(Socket,Term)
is returned when some process whose socket file descriptor is Socket has called tcp_send/2 (see ipc-tcp-trm-send2). This is the result of a read from the socket.
end_of_file(Socket)
is returned when the connection is lost to the process whose socket file descriptor is Socket. This is the result a read from the socket. The connection is shut down.

Windows caveats: