Chapter 22 Networking: Streams-Based Sockets and Datagrams (Web site designers) 1141

Chapter 22 Networking: Streams-Based Sockets and Datagrams 1141 A port number is a numeric ID number that a process uses to identify itself at a given network address, also known as an Internet Protocol Address (IP Address). An individual process running on a computer is identified by an IP address/port number pair. Hence, no two processes can have the same port number at a given IP address. The establishment of a simple client requires four steps. In Step 1, we create a TcpClient to connect to the server. This connection is established through a call to the TcpClient method Connect containing two arguments the server s IP address and the port number In Step 2, the TcpClient uses method GetStream to get a Stream to write to and read from the server. Step 3 is the processing phase, in which the client and the server communicate. Step 4 has the client close the connection by calling the Close method on the NetworkStream. NetworkStream methods WriteByteand Write can be used to output individual bytes or sets of bytes to the server, respectively. NetworkStreammethods ReadByteand Readcan be used to read individual bytes or sets of bytes from the server, respectively. Class UdpClientis provided for connectionless transmission of data. Class UdpClientmethods Sendand Receive are used to transmit data. Class IPEndPoint represents an endpoint on a network. Class IPAddress represents an Internet Protocol address. Multithreaded servers can manage many simultaneous connections with multiple clients. TERMINOLOGY 127.0.0.1 AcceptSocket method of class TcpListener Berkeley Sockets Interface BinaryReader class BinaryWriterclass Bind method of class Socketbinding a server to a port block block until connection received client client/server chat client/server model Close method of class SocketClose method of class TcpClient collaborative applications Connect method of class TcpListenerconnection connection attempt connection between client and server terminates connection port connection to a server connectionless service connectionless transmission with datagrams connection-oriented service connection-oriented, streams-based transmission datagram datagram socket duplicate of datagram echo a packet back to a client e-mail Exit method of class Environment ExitCode property of class Environment file processing GetStream method of class Socket infinite loop Internet Protocol Addresses (IP Address) IP Address IPAddress class IPEndPoint class LAN Local Area Network (LAN) localhost loopback IP address Loopbackstatic member of class IPAddress Microsoft Internet Explorer Netscape Communicator
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web design programs services

Leave a Reply