Clever Geek Handbook
πŸ“œ ⬆️ ⬇️

Programming Network Tasks

In the field of computerization, the concept of programming network tasks or otherwise called network programming ( network programming ), which is quite similar to the concepts of socket programming and client-server programming , involves writing computer programs that interact with other programs through a computer network .

The program or process initiating the connection is called the client process, and the program that is waiting for the connection to start is called the server process. Client and server processes together form a distributed system . The connection between the client and server processes can be either (for example, a TCP protocol establishing a virtual connection or ) or (based on UDP datagrams).

A program that can function both as a client and as a server is based on peer- to -peer communication.

Sockets are typically implemented by an application programming interface (API) library, such as Berkeley sockets , first introduced in 1983. Most implementations are based on Berkeley sockets , such as Winsock , introduced in 1991. There are other socket API implementations, such as STREAMS- based Transport Layer Interface (TLI).

The following are examples of functions or methods commonly implemented by the API library:

  • socket() creates a new socket of a certain type, identified by an integer, and then allocates system resources to it.
  • bind() is typically used on the server side; associates a socket with the address structure of the sockets, that is, a specific local port number and IP address.
  • listen() used on the server side; puts the TCP socket in listening mode.
  • connect() used on the client side; binds an idle local port number to a socket. In the case of a TCP socket, it causes an attempt to establish a new TCP connection.
  • accept() used on the server side. This function accepts the received attempt to create a new TCP connection from a remote client and creates a new socket associated with a pair of socket addresses of this connection.
  • send() and recv() or write() and read() or recvfrom() and sendto() are used to send and receive data to / from the remote socket.
  • close() causes the release of system resources allocated to the socket. In the case of TCP, the connection ends.

See also

  • Interprocess communication (IPC)

Notes

Links

  • Beej Network Programming Guide
  • Networking Basics - Networking Basics from a Java Perspective
Source - https://ru.wikipedia.org/w/index.php?title=Network_Task_programming&oldid=91333667


More articles:

  • Hongzehu
  • Lac (Ivory Coast)
  • Pepper, Beverly
  • Wida
  • Highest Type
  • Ferroviario (football club, Fortaleza)
  • Luguhu
  • Baxter District (Wikipedia)
  • Polyusuk, Natan Mikhailovich
  • Malaya Okhta (historic district)

All articles

Clever Geek | 2019