Concurrent TCP servers. The basic idea 1 client = 1 task. The task is alive as long until the connection is closed The task closes the connection.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Nonblocking I/O Blocking vs. non-blocking I/O
Client Server. Server Client Model Servers- Wait for requests from clients - Sends requested data to client - May have to communicate with other servers.
Socket Programming ENTERPRISE JAVA. 2 Content  Sockets  Streams  Threads  Readings.
Web Server Implementation On DE2 Final Presentation
Programming with TCP – I
Today’s topic Issues about sending structures with TCP. Server design alternatives: concurrent server and multiplexed server. I/O multiplexing.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Concurrent vs. iterative servers
TCP connection my Computertelnet client web server remote computer 1 character per transmission Telnet uses TCP connection.
TCP connection my Computertelnet client web server remote computer 1 character per transmission * Telnet uses TCP connection * but Nagle's algorithm modifies.
Advanced UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
Understanding Factors That Influence Performance of a Web Server Presentation CS535 Project By Thiru.
Hands On Networking Socket Programming Ram P Rustagi, ISE Dept Abhishek Gupta, ISE Dept Laxmi Kuber, MCA Dept June 28-30, 2012.
Programming Network Servers Topic 6, Chapters 21, 22 Network Programming Kansas State University at Salina.
Slow Web Site Problem Analysis Last Update Copyright 2013 Kenneth M. Chipps Ph.D. 1.
Project Assignment 1 Ying Zhang EECS 489 W07. Clarification Questions for each test Expected output for each test.
Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Multi-part Messages in KMIP John Leiseboer, QuintessenceLabs.

Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties.
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
Nonblocking I/O Blocking vs. non-blocking I/O Nonblocking input, output, accept, and connect Readings –UNP Ch16 1.
1 (Worker Queues) cs What is a Thread Pool? A collection of threads that are created once (e.g. when a server starts) That is, no need to create.
Li Tak Sing COMPS311F. Case study: consumers and producers A fixed size buffer which can hold at most certain integers. A number of producers which generate.
Web Design & Development 1 Lec - 21 Umair Javed. Web Design & Development 2 Socket Programming.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
OS2014 PROJECT 2 Supplemental Information. Outline Sequence Diagram of Project 2 Kernel Modules Kernel Sockets Work Queues Synchronization.
2001 Networking Operating Systems (CO32010) 1. Operating Systems 2. Processes and scheduling 4.
Networking Basics CCNA 1 Chapter 11.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Client/Server Socket Programming Project
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 5.
Acknowledgement: These slides are adapted from slides provided in Thißen & Spaniol's course Distributed Systems and Middleware, RWTH Aachen Processes Distributed.
Berkeley Socket Abstraction
LECTURE 11 Networking Part 2. NETWORKING IN PYTHON At this point, we know how to write a simple TCP client and simple TCP server using Python’s raw sockets.
1 EPICS Flow of Control: EPICS Workshop at IHEP, Beijing, August 2001 EPICS Flow of Control Marty Kraimer APS.
Using TCP sockets in Perl Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
Networking Code CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
State Diagrams Andrew Hoos Derek Swager. Server State Diagram Displaying (Single) Waiting (Single) Single Connecting Ready Send Question Receive Answer.
Thread Pools (Worker Queues) cs
Reactive Android Development
Thread Pools (Worker Queues) cs
Quick UDP Internet Connections
Do-more Technical Training
Concurrent vs. iterative servers
Some bits on how it works
Magda El Zarki Professor, ICS UC, Irvine
Network Architecture Introductory material
Client-Server Interaction
Internet Control Message Protocol (ICMP)
Review of Important Networking Concepts
Distributed architectures
IS 4506 Server Configuration (HTTP Server)
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
HTTP/2.
When you connect with DHCP, you are assigned a
Advanced UNIX programming
Internet Applications & Programming
Multiple HTTP Requests from One TCP Connection
An Introduction to Internetworking
NETWORK PROGRAMMING CNET 441
Testing servers.
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Information Retrieval and Web Design
Presentation transcript:

Concurrent TCP servers

The basic idea 1 client = 1 task. The task is alive as long until the connection is closed The task closes the connection

Why make servers concurrent? Concurrency One server can service several clients at the same time. One client does not have to wait for another client to finish… No waiting for I/O Some servers (like HTTP and file servers) read files. Reading a file takes a lot of time (compared to other operations) Robustness 1 One buggy/evil (or just slow) client cannot “take over” the server Example: The client makes a connection, but never sends a request Robustness 2 An error in the handling of a client, does not affect the handling of other clients.

Concurrent TCP servers: C# task Server = New TcpListener(host, port) Server.Start(); While (true) Client = server.AcceptTcpClient(); Task.Run(() => DoIt(client)); DoIt(client) gives service to this client.

Concurrent TCP servers: C# helper class Sometimes Task.Run(…) is to simple … Make a helper class to handle the request DoIt() is implemented in the helper class Parameters are handed to the helper class through its constructor Server = New TcpListener(host, port) Server.Start(); While (true) Client = server.AcceptTcpClient(); Helper helper = new Helper(client, other parameters); Task.Run(() => helper.DoIt());