Introduction to Client/Server Design

Slides:



Advertisements
Similar presentations
Socket Programming ENTERPRISE JAVA. 2 Content  Sockets  Streams  Threads  Readings.
Advertisements

HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
2: Application Layer 1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
1 HTTP and some other odds and ends Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
16-Jun-15 HTTP Hypertext Transfer Protocol. 2 HTTP messages HTTP is the language that web clients and web servers use to talk to each other HTTP is largely.
1 Overview r Socket programming with TCP r Socket programming with UDP r Building a Web server.
Network Programming CS3250. References Core Java, Vol. II, Chapter 3. Book examples are available from
CIS – Spring Instructors: Geoffrey Fox, Bryan Carpenter Computational Science and.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L22 (Chapter 25) Networking.
2: Application Layer1 Socket Programming. 2: Application Layer2 Socket-programming using TCP Socket: a door between application process and end- end-transport.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
PL-IV- Group A HTTP Request & Response Header
CSE 341, S. Tanimoto Java networking- 1 Java Networking Motivation Network Layers Using Sockets A Tiny Server Applets URLs Downloading Images, MediaTracker.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HTTP Protocol Specification
2: Application Layer1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Web Server Architecture. Complex –Helpful to consider best design practices Items to consider –Response Time Use concurrency –Features HTTP/1.1 CGI.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT.
Cli/Serv.: Chat/121 Client/Server Distributed Systems v Objectives –discuss a client/server based chat system –mention two other ways of chatting.
Lab 6: Introduction to Sockets (Web Programming – Part 1) Reference: Head First Java (2 nd Edition) by Kathy Sierra & Bert Bates.
1 Streams Files are a computer’s long term memory Need ability for programs to –get information from files –copy information from program variables to.
Networks Sockets and Streams. TCP/IP in action server ports …65535 lower port numbers ( ) are reserved port echo7 time13 ftp20 telnet23.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Introduction to Java Network Programming and HTTP
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Java Server Programming Web Interface for Java Programs.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
1 Lecture 9: Network programming. 2 Manipulating URLs URL is an acronym for Uniform Resource Locator and is a reference (an address) to a resource on.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Network Programming: Servers. Agenda l Steps for creating a server Create a ServerSocket object Create a Socket object from ServerSocket Create an input.
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Bapi Chatterjee Prajith R G.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
What’s Really Happening
Prepared by: Dr. Abdallah Mohamed, AOU-KW Unit9: Internet programming 1.
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Aras Atalar Prajith R G.
HTTP – An overview.
The Hypertext Transfer Protocol
CSE 341, S. Tanimoto Java networking-
Computing with C# and the .NET Framework
Clients and Servers 19-Nov-18.
Chapter 2: outline 2.1 principles of network applications
Hypertext Transfer Protocol
Clients and Servers 1-Dec-18.
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Hypertext Transfer Protocol
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Aras Atalar Prajith R G 24/01/2018.
Web Server Design Week 6 Old Dominion University
Hypertext Transfer Protocol
Uniform Resource Locators
Socket Programming 2: Application Layer.
Traditional Internet Applications
HTTP Hypertext Transfer Protocol
Chapter 2: Application layer
Hypertext Transfer Protocol
Presentation transcript:

Introduction to Client/Server Design CSCI 392 Java Programming Dr. Dannelly

Standard Client/Server Design main server process client initial handshaking request messages response messages server subprocess

Web Example Client (Web Browser) connect to port 80 of the machine send the formatted request read reply Server Child read request if file exist send file contents else send "404 not found" Web Server for(;;) wait for connection create child to handle request

HTTP message formats Request Message Reply Message GET /path/file HTTP/1.0 misc headers blank line Reply Message HTTP/1.1 200 OK Content-Length: 3731 Content-Type: text/html Last-Modified: Tue, 16 Aug 2011 21:10:01 GMT Accept-Ranges: bytes ETag: "6178b5dc585ccc1:1819e" Server: Microsoft-IIS/6.0 MicrosoftOfficeWebServer: 5.0_Pub X-Powered-By: ASP.NET Connection: close <html> <head> <title>Steve Dannelly</title>

Sample Client Code // connect to the server Socket sock = new Socket ("faculty.winthrop.edu",80); // get the reading and writing streams InputStream sin = sock.getInputStream(); BufferedReader fromServer = new BufferedReader(new InputStreamReader(sin)); OutputStream sout = sock.getOutputStream(); PrintWriter toServer = new PrintWriter (new OutputStreamWriter(sout));

see text pages 258-262 for more details Full Code Examples web1.java web2.java see text pages 258-262 for more details

Helpful String Methods Compare two strings String name1, name2; ... if ( name1.compareTo(name2) < 0 ) Append name += " "; name = first + last;

Really Useful String Methods Find a string in a larger string int firstspace = mystring.indexOf(" "); int lastspace = mystring.lastIndexOf(" "); Extracting Substrings String pre_space; pre_space=mystring.substring(0,firstspace);

example substring code // program to test substrings public class string5 { public static void main (String[] args) String first,last; String bob = "bob jones"; int space = bob.indexOf (" "); System.out.println ("Space is at " + space); first = bob.substring ( 0 , space ); last = bob.substring ( space+1 ); System.out.println ("first = |" + first + "| and last = |" + last + "|"); }