Stream sockets are connected using the standard sequence, i.e. socket/3, bind/2, listen/2 and accept/3 on the server and socket/3 and connect/2 on the client. After the sockets are connected, both processes can use them for reading and writing.
Success: socket(internet, stream, s), bind(s, Addr), listen(s, 1). Error: listen(s, N) (Error 4). listen(s, 1.0) (Error 5). listen(null, 2) (Error 170).