Software Engineering Recitation 2 Suhit Gupta. Today we will be covering… XML II Sockets, Server – Client relationships, Servers capable of handling multiple.

Slides:



Advertisements
Similar presentations
XMLSchema to TTCN-3 Mapping Importing XML schema based data types into TTCN-3.
Advertisements

1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
H. 323 and firewalls: Problem Statement and Solution Framework Author: Melinda Shore, Nokia Presenter: Shannon McCracken.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
1 Overview r Socket programming with TCP r Socket programming with UDP r Building a Web server.
1 Programming Section 9 James King 12 August 2003.
XML Simple Types CSPP51038 shortcourse. Simple Types Recall that simple types are composed of text-only values. All attributes are of simple type Elements.
XML Schema Matthias Hauswirth. Agenda 4 W3C Process 4 XML Schema Requirements 4 The Specifications 4 Schema Tools.
CIS – Spring Instructors: Geoffrey Fox, Bryan Carpenter Computational Science and.
XML Schemas and Namespaces Lecture 11, 07/10/02. BookStore.dtd.
28-Jun-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
2: Application Layer1 Socket Programming. 2: Application Layer2 Socket-programming using TCP Socket: a door between application process and end- end-transport.
Welcome to CIS 235 Computer Networks Fall, 2007 Prof Peterson.
15-Jul-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
CSE 341, S. Tanimoto Java networking- 1 Java Networking Motivation Network Layers Using Sockets A Tiny Server Applets URLs Downloading Images, MediaTracker.
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
2: Application Layer 1 Socket Programming TCP and UDP.
CECS 5460 – Assignment 3 Stacey VanderHeiden Güney.
Greg Jernegan Brandon Simmons. The Beginning…  The problem Huge demand for internet enabled applications and programs that communicate over a network.
Network Redundancy Multiple paths may exist between systems. Redundancy is not a requirement of a packet switching network. Redundancy was part of the.
Intranet, Extranet, Firewall. Intranet and Extranet.
CS4273: Distributed System Technologies and Programming I Lecture 5: Java Socket Programming.
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.
NET0183 Networks and Communications Lecture 31 The Socket API 8/25/20091 NET0183 Networks and Communications by Dr Andy Brooks Lecture powerpoints from.
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
NETWORKING COMPONENTS AN OVERVIEW OF COMMONLY USED HARDWARE Christopher Johnson LTEC 4550.
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
Object Oriented Programming in Java Lecture 16. Networking in Java Concepts Technicalities in java.
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.
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.
Networks Sockets and Streams. TCP/IP in action server ports …65535 lower port numbers ( ) are reserved port echo7 time13 ftp20 telnet23.
 2003 Joel C. Adams. All Rights Reserved. Calvin CollegeDept of Computer Science(1/11) Java Sockets and Simple Networking Joel Adams and Jeremy Frens.
1 cs205: engineering software university of virginia fall 2006 Network Programming* * Just enough to make you dangerous Bill Cheswick’s map of the Internet.
CS390- Unix Programming Environment CS 390 Unix Programming Environment Java Socket Programming.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
2: Application Layer1 Socket programming Socket API Explicitly created, used, released by apps Client/server paradigm Two types of transport service via.
Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
CS 4244: Internet Programming Network Programming in Java 1.0.
Java Server Programming Web Interface for Java Programs.
Part 4: Network Applications Client-server interaction, example applications.
CSE 6331 © Leonidas Fegaras XML Schema 1 XML Schema Leonidas Fegaras.
By Vivek Dimri. Basic Concepts on Networking IP Address – Protocol – Ports – The Client/Server Paradigm – Sockets The Java Networking Package – The InetAddress.
ISDS 4120 Project 1 DWAYNE CARRAL JR 3/27/15. There are seven layers which make up the OSI (Open Systems Interconnection Model) which is the model for.
Lecture 0 W3C XML Schema. Topics Status Motivation Simple type vs. complex type.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Networking Code CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 Java API for distributed computing.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 11 Omar Meqdadi Department of Computer Science and Software Engineering University.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Echo Networking COMP
Chapter Objectives In this chapter, you will learn:
CSE 341, S. Tanimoto Java networking-
I. Basic Network Concepts
Basic Protocols 24-Nov-18.
THE DATATYPES OF XML SCHEMA A Practical Introduction
X-Informatics: I-400 and I-590 XML Schema
Socket Programming.
Basic Protocols 19-Feb-19.
Socket Programming 2: Application Layer.
CPSC 441 UDP Socket Programming
Distributed Computing
Chapter 2: Application layer
CS18000: Problem Solving and Object-Oriented Programming
Presentation transcript:

Software Engineering Recitation 2 Suhit Gupta

Today we will be covering… XML II Sockets, Server – Client relationships, Servers capable of handling multiple clients.

XML - Elements Elements are capable of taking on several values – –string boolean float double decimal timeInstant timePeriod month year century recurringDate recurringDay timeDuration recurringDuration binary uriReference ID IDREF ENTITY NOTATION language IDREFS ENTITIES NMTOKEN NMTOKENS Name QName NCName integer nonPositiveInteger negativeInteger long int short byte nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte positiveInteger date time –And on and on and on and on….. –Read the primer 0 for more and in depth information

XML – values

XML – minOccurs/maxOccurs Adding Attributes to the Inline Type Definition

XML – max/min [II] You can specify max and min values By combining and nesting the various groups provided by XML Schema, and by setting the values of minOccurs and maxOccurs, it is possible to represent any content model expressible with an XML. minOccurs maxOccurs

XML – Attribute groups Adding Attributes Using an Attribute Group.

XML Attribute groups [II] Using an attribute group in this way can improve the readability of schema, and facilitates updating schema because an attribute group can be defined and edited in one place and referenced in multiple definitions and declarations. These characteristics of attribute groups make them similar to parameter entities in XML

XML – Choice and Sequence Nested Choice and Sequence Groups

XML – Choice and Sequence [II] A choice group element allows only one of its children to appear in an instance. choice Un-named groups of elements can be constrained so that only one of the elements may appear in an instance. Alternatively, they can also be defined, and along with elements in named groups, they can be constrained to appear in the same order (sequence) as they are declared.

XML - Conclusion I think that should be it on XML. Any more info… read about it on the web XML Primer xmlschema / xmlschema /

Network basics link: connection between components, including wireless => point-to-point (modem), multiple access (Ethernet) router, switch: forward packets node: router (= intermediate system), host (= end system) clients: access resources and services servers: provide resources and services (may also be client) dumb terminal: no local processing

Firewalls computer between internal (“intranet”) and external network = policy-based packet filtering watch single point rather than every PC limit in/out services, restrict incoming packets can’t prevent people walking out with disks packet filter: restrict IP addresses (address filtering), ports connection filter: only allow packets belonging to authorized (TCP) connections encrypted tunnel: tunnel = layer same layer inside itself à virtual network: connect intranets across Internet NA(P)T: network address (and port) translator are not firewalls, but can prevent all incoming connections

NAT

Sockets What are ports? What are sockets? What is the difference?

Simple Client – Janak Parekh import java.net.*; import java.io.*; public class client { public static void main(String[] args) { try { Socket s = new Socket(" ",2099); BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter pw = new PrintWriter(s.getOutputStream()); /* The following comment does not work as intended--Java is too clever * about connections, so this line gets printed immediately */ // System.out.println("Connected to server, talking"); pw.println("Hello"); pw.flush(); // Now wait for something back String st = br.readLine(); System.out.println(st); // Clean up s.close(); } catch(Exception e) { e.printStackTrace(); }

Simple Server – Janak Parekh import java.net.*; import java.io.*; public class server { public static void main(String[] args) { try { ServerSocket s = new ServerSocket(2099); while(true) { Socket t = s.accept(); BufferedReader br = new BufferedReader(new InputStreamReader(t.getInputStream())); PrintWriter pw = new PrintWriter(t.getOutputStream()); // Wait for hello String st = br.readLine(); System.out.println("I got " + st + ", I'm going to send something back"); Thread.sleep(5000); // Now respond pw.println("Hey, how are you!?"); pw.flush(); // Close the connection t.close(); } } catch(Exception e) { e.printStackTrace(); }

Multithreaded Server A Multithreaded Server – The code The code The server calls on the Multiserver part – The codeThe code

Parse this Stream/File The code from Recitation 1 is one example Here is another The code The code

Conclusion That should be it… questions???