Changes between Version 20 and Version 21 of ChapterNetworking
- Timestamp:
- 12/02/07 15:54:05 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChapterNetworking
v20 v21 47 47 Before we can create a socket, we will need to describe how it will be used and how it will communicate with another socket. Most network programs use maybe one or two types of sockets for the majority of tasks, but flexibility demands that many options be available to the programmer. Therefore, during creation of a socket, we need to specify several socket features that define how we will later communicate through the socket. There are three types of attributes to set: 48 48 49 * theaddress family50 * thesocket type51 * theprotocol type49 * address family 50 * socket type 51 * protocol type 52 52 53 53 The address family describes how all communication points or nodes will be addressed or accessed through the new socket. For example, if we create a socket with !AddressFamily.INET, then all communications through the socket are expected to use a 32-bit internet address (eg. 127.0.0.1) and a 16-bit port number. Using !AddressFamily.UNIX means that we expect to communicate through the socket using a local UNIX file path descriptor as an address. Here is a list of address family's provided by the Tango Socket: