CPSC 3600 - DAY 3 JANUARY 18, 2017 ================================================================================ INTRODUCTION TO NETWORK PROGRAMMING ----------------------------------- .Network programming and socket programming are used interchangeably. .Client and Server. .Client program initiates communication. .Server program waits passively for and then responds to client that contacts it. .Both client and server computers can run multiple applications at the same time, e.x. browser, IM, etc. .Server starts first, client starts second. .Communicates through sockets. .Server Identification. .to identify a server, it needs to know the IP address and the port number. .The client-server distinction is important because the client needs to know the server's address and port initially. .The server can learn the client's address information when it recieves the initial communication from the client. .Concurrent Servers .A server can handle more than one client at a time. .It uses more than one thread. .A client does not have to wait for a previous client to finish .For example, one client is downloading a movie, while the second client requests a short download (song). .Socket .A socket is an abstraction through which an application may send a recieve data. .A socket allows an application to plug in to the network and communicate with other applications that are plugged in to the same network .Information written to the socket by an application on one machine can be read by an application on a different machine. .TCP vs. UDP .Transmission Control Protocol (TCP): reliable, connection oriented. .User Datagram Protocol (UDP): unreliable, connectionless .The TCP and UDP protocols are two different commmunication protocols that handle data communications between terminals in an IP network (the Internet)