Computer network programming

Computer network programming

In computing, network programming, essentially identical to socket programming or client–server programming, involves writing computer programs that communicate with other programs across a computer network. The program or process initiating the communication is called a client process, and the program waiting for the communication to be initiated is the server process. The client and server processes together form a distributed system. The communication between the client and server process may either be connection-oriented (such as an established TCP virtual circuit or session), or connectionless (based on UDP datagrams).

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

Sockets are usually implemented by an API library such as Berkeley sockets, first introduced in 1983. Most implementations are based on Berkeley sockets, for example Winsock, introduced in 1991. Other socket API implementations exist, such as the STREAMS-based Transport Layer Interface (TLI).

These are examples of functions or methods typically provided by the API library:

  • socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it.
  • bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address.
  • listen() is used on the server side, and causes a bound TCP socket to enter listening state.
  • connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection.
  • accept() is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection.
  • send() and recv(), or write() and read(), or recvfrom() and sendto(), are used for sending and receiving data to/from a remote socket.
  • close() causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Network programming — may refer to one of several things: Network programming, (computer) Network programming, (television) This disambiguation page lists articles associated with the same title. If an internal link led you here, you …   Wikipedia

  • computer science — computer scientist. the science that deals with the theory and methods of processing information in digital computers, the design of computer hardware and software, and the applications of computers. [1970 75] * * * Study of computers, their… …   Universalium

  • computer — computerlike, adj. /keuhm pyooh teuhr/, n. 1. Also called processor. an electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations. Cf. analog… …   Universalium

  • Computer — For other uses, see Computer (disambiguation). Computer technology redirects here. For the company, see Computer Technology Limited. Computer …   Wikipedia

  • Computer security — This article is about computer security through design and engineering. For computer security exploits and defenses, see computer insecurity. Computer security Secure operating systems Security architecture Security by design Secure coding …   Wikipedia

  • Computer multitasking — In computing, multitasking is a method where multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running at any point in time, meaning… …   Wikipedia

  • Computer Go — Part of a series of articles on Go (board game) Game specifics Go rules Go handicaps Go proverbs Go terms Go strategy and tactics Fuseki (whole board openings) Joseki (corner based openings) Life and death Tsumego …   Wikipedia

  • computer science — noun the branch of engineering science that studies (with the aid of computers) computable processes and structures • Syn: ↑computing • Topics: ↑computer, ↑computing machine, ↑computing device, ↑data processor, ↑electronic computer, ↑ …   Useful english dictionary

  • Network simulator — A network simulator is a piece of software or hardware that predicts the behavior of a network, without an actual network being present. Contents 1 Uses of network simulators 2 Examples of network simulators 3 See also …   Wikipedia

  • Network Driver Interface Specification — The Network Driver Interface Specification (NDIS) is an application programming interface (API) for network interface cards (NICs). It was jointly developed by Microsoft and 3Com Corporation, and is mostly used in Microsoft Windows, but the open… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”