Client Server

[email protected]> ,/stream_client [email protected]> ,/stream_server

Connect to Wait for connection on port 7777

Numeric: 335653056

Client: Send: 'HelloWorld' Numeric: 3232235786

Bytes received: 11

Bytes received: 11 Text: 'HelloWorld'

Text: 'HelloWorld'

Connection closed.

6Under Linux (and all other Unix flavors), all ports between 1 and 1,024 are referred to as reserved ports and may be used only by processes with root rights. For this reason, we use the free port number 7,777.

A 4-tuple notation (, 6) is used to uniquely identify a connection. The first element specifies the address and port of the local system, the second the address and port of the client.

An asterisk (*) is substituted if one of the elements is still undefined. A server process listening on a passive socket but not yet connected to a client is therefore denoted by, *.*.

Two socket pairs are registered in the kernel once a server has duplicated itself with fork to handle a connection.

Continue reading here: Listen Established

Was this article helpful?

0 0