1 / 8

Advanced Sockets

Introduction to Networking , Instructor: Prof. Yan Chen. Advanced Sockets. Ashish Gupta TA , Intro to Networking Jan 14 2004 Recital 2. The problem. You are a server and you want to listen for incoming connections as well as keep reading from the connections you already have. Blocking

tracen
Download Presentation

Advanced Sockets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Networking , Instructor: Prof. Yan Chen Advanced Sockets Ashish Gupta TA , Intro to Networking Jan 14 2004 Recital 2

  2. The problem You are a server and you want to listen for incoming connections as well as keep reading from the connections you already have. • Blocking • "block" is techie jargon for "sleep". • Lots of functions block. • accept() blocks. • All the recv() functions block

  3. The select call Enables you to deal with many clients at the same time HOW ? Monitors several sockets at the same time. tell you which ones are ready for reading, which are ready for writing,

  4. THE CODE A multi-person chat server

  5. DEMO A multi-person chat server

  6. Important Points • Accepting new connections via select • Client closes connection • Select returns “socket ready to read” • recv() will return 0.

  7. 1-5 • Transmission Delay • Propagation Delay • Message switched • Packet Switched • Circuit-switched vs Datagram • Differences in : Setup time, Store-and forward delay.

  8. 2-13 • Local Delay + Internet delay • What is Beta and Delta here ? • caching

More Related