Informatika    
   
Daftar Isi
(Sebelumnya) Computer network diagramComputer program (Berikutnya)

Computer network programming

Computer network programming involves writing computer programs that enable processes to communicate with each other across a computer network.

Contents

Network programming is client–server programming

Interprocess communication, even if it is bidirectional, cannot be implemented in a perfectly symmetric way: to establish a communication channel between two processes, one process must take the initiative, while the other is waiting for it. Therefore, network programming unavoidably assumes a client–server model: The process initiating the communication is a client, and the process waiting for the communication to be initiated is a server. The client and server processes together form a distributed system. In a peer-to-peer communication, the program can act both as a client and a server.

Network programming is socket programming

The endpoint in an interprocess communication is called a socket, or a network socket for disambiguation. Since most communication between computers is based on the Internet Protocol, an almost equivalent term is Internet socket. The data transmission between two sockets is organised by communications protocols, usually implemented in the operating system of the participating computers. Application programs write to and read from these sockets. Therefore, network programming is essentially socket programming.

Standard API

The reference application programming interface for socket programming is the Berkeley (or BSD) sockets API, first introduced in 1983, which has evolved into a POSIX standard. Application programs create, control, and use sockets through system calls like socket(), bind(), listen(), connect(), send(), recv().

Further reading

  • W. Richard Stevens: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X.
(Sebelumnya) Computer network diagramComputer program (Berikutnya)