Java Networking Yoshi. What we have learnt before  Java I/O  Decorator pattern (Very important!)  Use java.net.Socket to connect to a server  Have.

Slides:



Advertisements
Similar presentations
Client Server. Server Client Model Servers- Wait for requests from clients - Sends requested data to client - May have to communicate with other servers.
Advertisements

Analysis of Tools to Support Remote Access to a K12 Classroom John Bowling.
Using TCP sockets in Java Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
Online Educational Game of Snakes and Ladders -Shalini Pradhan -Manali Joshi -Uttara Paingankar -Seema Joshi.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
Multiple Tiers in Action
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L22 (Chapter 25) Networking.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
Networking Support In Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Sidcley Soares.  Introduction to Android  Creating a hello world project in Android  Java Sockets  Android Sockets  references.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
Implementing Application Protocols. Overview An application protocol facilitates communication between applications. For example, an client uses.
Networking with Java CSc 335 Object-Oriented Programming and Design Spring 2009.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Web Proxy Server. Proxy Server Introduction Returns status and error messages. Handles http CGI requests. –For more information about CGI please refer.
WEB DESIGN SOME FOUNDATIONS. SO WHAT IS THIS INTERNET.
Socket Programming in Java -First Step of Network Programming-
Socket Programming -What is it ? -Why bother ?. Basic Interface for programming networks at transport level It is communication end point Used for inter.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
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.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ProCol~ A jEdit Plugin for Remote Project Collaboration Justin Dieters Spring 2004 CS470 Final Presentation.
Introduction »Paul Foster »President CEO – Pick Up And Play »Focus of information  Vote on level.
Introduction to Interprocess communication SE-2811 Dr. Mark L. Hornick 1.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 23 How Web Host Servers Work.
Outline Overview Video Format Conversion Connection with An authentication Streaming media Transferring media.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
Practicum: - Client-Server Computing in Java Fundamental Data Structures and Algorithms Margaret Reid-Miller 13 April 2004.
1 Welcome to CSC 301 Web Programming Charles Frank.
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 (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
1 Network Programming and Java Sockets. 2 Network Request Result a client, a server, and network Client Server Client machine Server machine Elements.
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.
Java Sockets Tutorial Rahul Malik Nov 12, 2005.
Network Programming All networked computers have an IP Address – Unique – In the form of xxx.xxx.xxx.xxx ( ) – 32 bits = ~4 billion possibilities.
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
CS 4244: Internet Programming Network Programming in Java 1.0.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
Networks Part 3: Packet Paths + Wireshark NYU-Poly: HSWP Instructor: Mandy Galante.
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
14 1 Chapter 14 Web Database Development Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
 There are device known as Server  Web Server / HTTP Server  Each computer has unique number known as IP Address  Domain Name.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
Java Network Programming Network Programming Spring 2000 Jeffrey E. Care
Threads. Readings r Silberschatz et al : Chapter 4.
Proxy Pattern. What’s a Proxy? A remote proxy acts as a local representative of a remote object Remote Object: instantiated in a different JVM heap (a.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Bapi Chatterjee Prajith R G.
Java Networking I IS Outline  Quiz #3  Network architecture  Protocols  Sockets  Server Sockets  Multi-threaded Servers.
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.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
Java’s networking capabilities are declared by the classes and interfaces of package java.net, through which Java offers stream-based communications that.
Liang, Oreilly, Herbert Schildt, Joseph O’Neil, Simon Roberts, IBM Corp Advanced Java Programming CSE 7345/5345/ NTU 531 Multithreaded/Sockets/Server Welcome.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Networks Problem Set 3 Due Nov 10 Bonus Date Nov 9
Reactive Android Development
Affinity Depending on the application and client requirements of your Network Load Balancing cluster, you can be required to select an Affinity setting.
Multi Threading.
Development of Web Applications – Introduction revisited
Client-server Programming
Distributed Systems - Comp 655
TCP Protocol Analysis Access UMKC Home Page.
Uniform Resource Locators
TCP Protocol Analysis Access UMKC Home Page.
The reactor design pattern
Thread per client and Java NIO
Presentation transcript:

Java Networking Yoshi

What we have learnt before  Java I/O  Decorator pattern (Very important!)  Use java.net.Socket to connect to a server  Have you tried it?

A Case Study  Let’s implement a Tiny HTTP Server  First, we have to know something about HTTP protocol 

Tiny HTTP Server  Method outline  startServer  Waiting for client request  makeGUI (Not important here)  Draw a close button on the screen  processClient  Handle the HTTP Request  release  Release the port 80  main  Check the source code!

Tiny HTTP Server  What’s the problem with this version?  How many connections can it handle at the same time?

Threadless Wait for connection Handle

Threaded Version  Review java.lang.Thread and java.lang.Runnable  Remember that we have two ways to create threads!  Why?  Check the source code!  What the difference parts?

Threaded Wait for connection New Thread!

Can we make it better?  Can we run web-based application?  PHP, ASP, JSP…etc  Is it hard?  We have a competitor  Jetty 

Tools  Firefox add-on plug-in  HttpFox  Wireshark (known as Ethereal before)

Summary  java.io.*  o/package-summary.html o/package-summary.html  java.net.*  net/package-summary.html net/package-summary.html  Check it out!

Exercise  Expand the functionalities of this Tiny HTTP Server