Network/Socket Programming in Java. Rajkumar Buyya

Size: px
Start display at page:

Download "Network/Socket Programming in Java. Rajkumar Buyya"

Transcription

1 Network/Socket Programming in Java Rajkumar Buyya

2 Elements of C-S Computing a client, a server, and network Client Request Result Network Server Client machine Server machine

3 java.net Used to manage: URL streams Client/server sockets Datagrams

4 Part III - Networking ServerSocket(1234) Output/write stream Input/read stream Socket( , 1234) Server_name: manjira.cs.mu.oz.au 4

5 Server side Socket Operations 1. Open Server Socket: ServerSocket server; DataOutputStream os; DataInputStream is; server = new ServerSocket( PORT ); 2. Wait for Client Request: Socket client = server.accept(); 3. Create I/O streams for communicating to clients is = new DataInputStream( client.getinputstream() ); os = new DataOutputStream( client.getoutputstream() ); 4. Perform communication with client Receiive from client: String line = is.readline(); Send to client: os.writebytes("hello\n"); 5. Close sockets: client.close(); For multithreade server: while(true) { i. wait for client requests (step 2 above) ii. create a thread with client socket as parameter (the thread creates streams (as in step (3) and does communication as stated in (4). Remove thread once service is provided.

6 Client side Socket Operations 1. Get connection to server: client = new Socket( server, port_id ); 2. Create I/O streams for communicating to clients is = new DataInputStream( client.getinputstream() ); os = new DataOutputStream( client.getoutputstream() ); 3. Perform communication with client Receiive from client: String line = is.readline(); Send to client: os.writebytes("hello\n"); 4. Close sockets: client.close();

7 A simple server (simplified code) import java.net.*; import java.io.*; public class ASimpleServer { public static void main(string args[]) { // Register service on port 1234 ServerSocket s = new ServerSocket(1234); Socket s1=s.accept(); // Wait and accept a connection // Get a communication stream associated with the socket OutputStream s1out = s1.getoutputstream(); DataOutputStream dos = new DataOutputStream (s1out); // Send a string! dos.writeutf( Hi there ); // Close the connection, but not the server socket dos.close(); s1out.close(); s1.close(); 7

8 A simple client (simplified code) import java.net.*; import java.io.*; public class SimpleClient { public static void main(string args[]) throws IOException { // Open your connection to a server, at port 1234 Socket s1 = new Socket(" ",1234); // Get an input file handle from the socket and read the input InputStream s1in = s1.getinputstream(); DataInputStream dis = new DataInputStream(s1In); String st = new String (dis.readutf()); System.out.println(st); // When done, just close the connection and exit dis.close(); s1in.close(); s1.close(); 8

9 Echo Server Client.. //client.java: client interface to server import java.io.*; import java.net.*; public class client { int port_id; String server; Socket slink; DataOutputStream os; DataInputStream is; DataInputStream kbd; public client( String args[] ) { server = args[0]; port_id = Integer.valueOf(args[1]).intValue(); try { slink = new Socket( server, port_id ); os = new DataOutputStream( slink.getoutputstream() ); is = new DataInputStream( slink.getinputstream() ); kbd = new DataInputStream( System.in );

10 Echo Server Client.. catch( UnknownHostException e ) { System.err.println( "Don't know about host: " ); System.exit(1); catch( IOException e ) { System.err.println( "Could not get I/O for the connection to "+server); System.exit(1); void communicate() { while(true) { try { System.out.print("Enter Input <end to stop>: ");

11 Echo Server Client.. if( line.equals("end") ) { os.close(); is.close(); slink.close(); break; String line2 = is.readline(); System.out.println("Output: "+line2); catch( IOException e ) { System.out.println(e); public static void main( String [] args ) { if( args.length < 2 ) { System.out.println("Usage: java client server_name port_id" ); System.exit(1);

12 Echo Server... // server.java: echo server import java.io.*; import java.net.*; public class server { // public final static int PORT = 4779; public static void main( String [] args ) { ServerSocket server = null; DataOutputStream os = null; DataInputStream is = null; boolean shutdown = false; if( args.length < 1 ) { System.out.println( "Usage: java server port_num" ); System.exit( 1 ); int PORT = Integer.valueOf(args[0]).intValue();

13 Echo Server... catch( IOException e ) { System.err.println( "Could not get I/O for the connection to: "); while(!shutdown) { if( server!= null ) { try { Socket client = server.accept(); System.out.println("Connected"); InetAddress cip = client.getinetaddress(); System.out.println( "Client IP Addr: "+cip.tostring()); is = new DataInputStream( client.getinputstream() ); os = new DataOutputStream(

14 Echo Server... if( line.startswith("end" ) ) { shutdown = true; break; os.writebytes(line.touppercase()); os.writebytes("\n"); System.out.println(line); is.close(); client.close(); catch( UnknownHostException e ) { System.err.println( "Server Open fails" ); catch( IOException e ) { System.err.println( "Could not get I/O for the connection

15 Echo Server System.out.println( "Server Down" ); try { server.close(); catch(ioexception e) {

16 Threads in Action... Multithreaded Server Client Process Server Process Server Threads Client Process User Mode Message Passing Facility Kernel Mode

17 Client/Server Computing Rajkumar Buyya

18 Client Server Definition server software accepts requests for data from client software and returns the results to the client

19 Elements of C-S Computing a client, a server, and network Client Request Result Network Server Client machine Server machine

20 Where Operations are Done In CS Relationship most of the application processing is done on a computer (client side), which obtains application services (such as database services) from another computer (server side) in a master slave configuration.

21 CS-Focus is on In client-server computing major focus is on SOFTWARE

22 Application Tasks User Interface Presentation Logic Application Logic Data Requests & Results Physical Data Management

23 Client (dumb) - Server Model Client Keystroke Server Presentation Logic Network Application Logic Displays DBMS

24 True Client-Server Model Client Presentation Logic Keystroke Processed Results Network Server Application Logic DBMS

25 Distributed Client-Server Model Client Application Logic Presentation Logic Processed Queries Processed Results Network Server Application Logic DBMS

26 Client-server computing is distributed access, not a distributed computing.

27 RPC Look and Feel like Local Calls results= bar(arguments) calling procedure results= called bar(arguments) procedure calling procedure (client) arguments results results= bar(arguments) called procedure (client) Local Procedure Call arguments client stub network transport request message results reply message Network Remote Procedure Call results arguments server stub network transport reply message request message

28 Flow Control in a Sychronous RPC Client Machine Server Machine Service Daemon Listening Client Program Client Waiting RPC Call with Request Network return ( ) reply Invoke Service Service Call return() answer Service Executes Request Completed May be the same machine

29 Multithreaded Server Client Process Server Process Server Threads Client Process User Mode Message Passing Facility Kernel Mode

30 Categories of Servers File Server Data Server Compute Server Database Server Communication Server Video Server

31 File Server File Servers manage a work group s application and data files, so that they may be shared by the group. Very I/O oriented Pull large amount of data off the storage subsystem and pass the data over the network Requires many slots for network connections and a large-capacity, fast hard disk subsystem.

32 Compute Server Performs Application logic processing Compute Servers requires processors with high performance capabilities large amounts of memory relatively low disk subsystems By separating data from the computation processing, the compute server s processing capabilities can be optimized

33 Data Server Data-oriented; used only for data storage and management Since a data server can serve more than one compute server, compute-intensive applications can be spread among multiple severs Does not prefer any application processing Performs processes such as validation, required as part management function. logic data of the data Requires fast processor, large amount of memory and substantial Hard disk capacity. Data Server Compute Server

34 Database Server Most typical use of technology in client-server Accepts requests for data, retrieves the data from its database(or requests data from another node)and passes the results back. Compute server with data server provides the same functionality. The server requirement depends on the size of database, speed with which the database must be updated, number of users and type of network used.

35 Communication Server Provides gateway to other LANs, networks & Computers Server & internet server Modest system requirements multiple slots fast processor to translate networking protocols

36 Internet Server Internet Server PC client Local Area Network UNIX workstations

37 Distributed processing application connects to remote database S Q L * Forms SQL *Net TCP/IP UNIX Server Distributed database application connects to local database which connects to remote database SQL *Net TCP/IP SQL * Forms SQL *Net TCP/IP ORACL E ORACLE Database Configurations

38 Client-Server Waves Ethernet era client/server Intergalactic era client/server First Wave Second Wave Third Wave File servers groupware Database servers TP monitors Distributed objects

39 The Client/Server Infrastructure Client Middleware Server Service Specific SQL/IDAPI TxRPC Mail ORB Objects GUI/OOUI DSM Groupware DSM Operating System SNMP CMIP DME Directory Security Distributed file RPC NOS Messaging Transport Stack Peer-to-peer NetBIOS TCP/IP IPX/SPX SNA TP monitor DBMS DSM Operating System

Agenda. Network Programming and Java Sockets. Introduction. Internet Applications Serving Local and Remote Users

Agenda. Network Programming and Java Sockets. Introduction. Internet Applications Serving Local and Remote Users Programming and Rajkumar Buyya Grid Computing and Distributed Systems (GRIDS) Laboratory Dept. of Computer Science and Software Engineering University of Melbourne, Australia http://www.cs.mu.oz.au/~raj

More information

NETWORK PROGRAMMING IN JAVA USING SOCKETS

NETWORK PROGRAMMING IN JAVA USING SOCKETS NETWORK PROGRAMMING IN JAVA USING SOCKETS Prerna Malik, Poonam Rawat Student, Dronacharya College of Engineering, Gurgaon, India Abstract- Network programming refers to writing programs that could be processed

More information

Java Network. Slides prepared by : Farzana Rahman

Java Network. Slides prepared by : Farzana Rahman Java Network Programming 1 Important Java Packages java.net java.io java.rmi java.security java.lang TCP/IP networking I/O streams & utilities Remote Method Invocation Security policies Threading classes

More information

Division of Informatics, University of Edinburgh

Division of Informatics, University of Edinburgh CS1Bh Lecture Note 20 Client/server computing A modern computing environment consists of not just one computer, but several. When designing such an arrangement of computers it might at first seem that

More information

Application Development with TCP/IP. Brian S. Mitchell Drexel University

Application Development with TCP/IP. Brian S. Mitchell Drexel University Application Development with TCP/IP Brian S. Mitchell Drexel University Agenda TCP/IP Application Development Environment Client/Server Computing with TCP/IP Sockets Port Numbers The TCP/IP Application

More information

Question1-part2 What undesirable consequences might there be in having too long a DNS cache entry lifetime?

Question1-part2 What undesirable consequences might there be in having too long a DNS cache entry lifetime? CSCI 312 - DATA COMMUNICATIONS AND NETWORKS FALL, 2014 Assignment 4 Working as a group. Working in small gruops of 2-4 students. When you work as a group, you have to return only one home assignment per

More information

Network Communication

Network Communication Network Communication Outline Sockets Datagrams TCP/IP Client-Server model OSI Model Sockets Endpoint for bidirectional communication between two machines. To connect with each other, each of the client

More information

Socket Programming. A er learning the contents of this chapter, the reader will be able to:

Socket Programming. A er learning the contents of this chapter, the reader will be able to: Java Socket Programming This chapter presents key concepts of intercommunication between programs running on different computers in the network. It introduces elements of network programming and concepts

More information

JAVA Program For Processing SMS Messages

JAVA Program For Processing SMS Messages JAVA Program For Processing SMS Messages Krishna Akkulu The paper describes the Java program implemented for the MultiModem GPRS wireless modem. The MultiModem offers standards-based quad-band GSM/GPRS

More information

Transport layer protocols. Message destination: Socket +Port. Asynchronous vs. Synchronous. Operations of Request-Reply. Sockets

Transport layer protocols. Message destination: Socket +Port. Asynchronous vs. Synchronous. Operations of Request-Reply. Sockets Transport layer protocols Interprocess communication Synchronous and asynchronous comm. Message destination Reliability Ordering Client Server Lecture 15: Operating Systems and Networks Behzad Bordbar

More information

Assignment 4 Solutions

Assignment 4 Solutions CSCI 312 - DATA COMMUNICATIONS AND NETWORKS FALL, 2014 Assignment 4 Solutions Working as a pair Working in pairs. When you work as a pair you have to return only one home assignment per pair on a round.

More information

Lesson: All About Sockets

Lesson: All About Sockets All About Sockets http://java.sun.com/docs/books/tutorial/networking/sockets/index.html Page 1 sur 1 The Java TM Tutorial Start of Tutorial > Start of Trail Trail: Custom Networking Lesson: All About Sockets

More information

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP CP4044 Lecture 7 1 Networking Learning Outcomes To understand basic network terminology To be able to communicate using Telnet To be aware of some common network services To be able to implement client

More information

Java Network Programming. The java.net package contains the Socket class. This class speaks TCP (connection-oriented protocol).

Java Network Programming. The java.net package contains the Socket class. This class speaks TCP (connection-oriented protocol). Java Network Programming The java.net package contains the Socket class. This class speaks TCP (connection-oriented protocol). The DatagramSocket class uses UDP (connectionless protocol). The java.net.socket

More information

Introduction to Java. Module 12: Networking (Java Sockets) Prepared by Costantinos Costa for EPL 233. ΕΠΛ233 Αντικειμενοστρεφής Προγραμματισμός 1

Introduction to Java. Module 12: Networking (Java Sockets) Prepared by Costantinos Costa for EPL 233. ΕΠΛ233 Αντικειμενοστρεφής Προγραμματισμός 1 Introduction to Java Module 12: Networking (Java Sockets) Prepared by Costantinos Costa for EPL 233 ΕΠΛ233 Αντικειμενοστρεφής Προγραμματισμός 1 What Is a Socket? A socket is one end-point of a two-way

More information

Creating a Simple, Multithreaded Chat System with Java

Creating a Simple, Multithreaded Chat System with Java Creating a Simple, Multithreaded Chat System with Java Introduction by George Crawford III In this edition of Objective Viewpoint, you will learn how to develop a simple chat system. The program will demonstrate

More information

Building a Multi-Threaded Web Server

Building a Multi-Threaded Web Server Building a Multi-Threaded Web Server In this lab we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous

More information

Socket-based Network Communication in J2SE and J2ME

Socket-based Network Communication in J2SE and J2ME Socket-based Network Communication in J2SE and J2ME 1 C/C++ BSD Sockets in POSIX POSIX functions allow to access network connection in the same way as regular files: There are special functions for opening

More information

Advanced Network Programming Lab using Java. Angelos Stavrou

Advanced Network Programming Lab using Java. Angelos Stavrou Advanced Network Programming Lab using Java Angelos Stavrou Table of Contents A simple Java Client...3 A simple Java Server...4 An advanced Java Client...5 An advanced Java Server...8 A Multi-threaded

More information

Socket Programming in Java

Socket Programming in Java Socket Programming in Java Learning Objectives The InetAddress Class Using sockets TCP sockets Datagram Sockets Classes in java.net The core package java.net contains a number of classes that allow programmers

More information

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

TP1 : Correction. Rappels : Stream, Thread et Socket TCP Université Paris 7 M1 II Protocoles réseaux TP1 : Correction Rappels : Stream, Thread et Socket TCP Tous les programmes seront écrits en Java. 1. (a) Ecrire une application qui lit des chaines au clavier

More information

Communicating with a Barco projector over network. Technical note

Communicating with a Barco projector over network. Technical note Communicating with a Barco projector over network Technical note MED20080612/00 12/06/2008 Barco nv Media & Entertainment Division Noordlaan 5, B-8520 Kuurne Phone: +32 56.36.89.70 Fax: +32 56.36.883.86

More information

AVRO - SERIALIZATION

AVRO - SERIALIZATION http://www.tutorialspoint.com/avro/avro_serialization.htm AVRO - SERIALIZATION Copyright tutorialspoint.com What is Serialization? Serialization is the process of translating data structures or objects

More information

Java Programming: Sockets in Java

Java Programming: Sockets in Java Java Programming: Sockets in Java Manuel Oriol May 10, 2007 1 Introduction Network programming is probably one of the features that is most used in the current world. As soon as people want to send or

More information

CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus

CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus 1. Purpose This assignment exercises how to write a peer-to-peer communicating program using non-blocking

More information

An Android-based Instant Message Application

An Android-based Instant Message Application An Android-based Instant Message Application Qi Lai, Mao Zheng and Tom Gendreau Department of Computer Science University of Wisconsin - La Crosse La Crosse, WI 54601 mzheng@uwlax.edu Abstract One of the

More information

Building a Java chat server

Building a Java chat server Building a Java chat server Presented by developerworks, your source for great tutorials Table of Contents If you're viewing this document online, you can click any of the topics below to link directly

More information

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, 4802-4807. Socket Programming

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, 4802-4807. Socket Programming Socket Programming Limi Kalita M.Tech Student, Department of Computer Science and Engineering, Assam Down Town University, Guwahati, India. Abstract: The aim of the paper is to introduce sockets, its deployment

More information

JAVA - FILES AND I/O

JAVA - FILES AND I/O http://www.tutorialspoint.com/java/java_files_io.htm JAVA - FILES AND I/O Copyright tutorialspoint.com The java.io package contains nearly every class you might ever need to perform input and output I/O

More information

Socket programming. Complement for the programming assignment INFO-0010

Socket programming. Complement for the programming assignment INFO-0010 Socket programming Complement for the programming assignment INFO-0010 Outline Socket definition Briefing on the Socket API A simple example in Java Multi-threading and Synchronization HTTP protocol Debugging

More information

The difference between TCP/IP, UDP/IP and Multicast sockets. How servers and clients communicate over sockets

The difference between TCP/IP, UDP/IP and Multicast sockets. How servers and clients communicate over sockets Network Programming Topics in this section include: What a socket is What you can do with a socket The difference between TCP/IP, UDP/IP and Multicast sockets How servers and clients communicate over sockets

More information

Network Programming using sockets

Network Programming using sockets Network Programming using sockets TCP/IP layers Layers Message Application Transport Internet Network interface Messages (UDP) or Streams (TCP) UDP or TCP packets IP datagrams Network-specific frames Underlying

More information

Socket Programming. Announcement. Lectures moved to

Socket Programming. Announcement. Lectures moved to Announcement Lectures moved to 150 GSPP, public policy building, right opposite Cory Hall on Hearst. Effective Jan 31 i.e. next Tuesday Socket Programming Nikhil Shetty GSI, EECS122 Spring 2006 1 Outline

More information

Sockets. Programação de Sockets em Java. Socket Abstractions. Camada de Transporte

Sockets. Programação de Sockets em Java. Socket Abstractions. Camada de Transporte Sockets Programação de Sockets em Java Server ports lients user space TP/UDP Socket API TP/UDP kernel space IP IP Ethernet Adapter Ethernet Adapter hardware SISTEMAS INFORMÁTIOS I, ENG. BIOMÉDIA SLIDES_10

More information

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast. Interprocess communication (Part 2) For an application to send something out as a message, it must arrange its OS to receive its input. The OS is then sends it out either as a UDP datagram on the transport

More information

Distributed Network Management Using SNMP, Java, WWW and CORBA

Distributed Network Management Using SNMP, Java, WWW and CORBA Distributed Network Management Using SNMP, Java, WWW and CORBA André Marcheto Augusto Hack Augusto Pacheco Augusto Verzbickas ADMINISTRATION AND MANAGEMENT OF COMPUTER NETWORKS - INE5619 Federal University

More information

public static void main(string[] args) { System.out.println("hello, world"); } }

public static void main(string[] args) { System.out.println(hello, world); } } Java in 21 minutes hello world basic data types classes & objects program structure constructors garbage collection I/O exceptions Strings Hello world import java.io.*; public class hello { public static

More information

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty("java.security.policy","../server.java.

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty(java.security.policy,../server.java. ExempleRMI.java import java.lang.*; import java.rmi.registry.*; import java.rmi.server.*; import java.io.*; import java.util.*; ExempleRMI.java import pkgexemple.*; public class ExempleRMI public static

More information

Chulalongkorn University International School of Engineering Department of Computer Engineering 2140105 Computer Programming Lab.

Chulalongkorn University International School of Engineering Department of Computer Engineering 2140105 Computer Programming Lab. Chulalongkorn University Name International School of Engineering Student ID Department of Computer Engineering Station No. 2140105 Computer Programming Lab. Date Lab 2 Using Java API documents, command

More information

Getting Started with the Internet Communications Engine

Getting Started with the Internet Communications Engine Getting Started with the Internet Communications Engine David Vriezen April 7, 2014 Contents 1 Introduction 2 2 About Ice 2 2.1 Proxies................................. 2 3 Setting Up ICE 2 4 Slices 2

More information

CISC 4700 L01 Network & Client- Server Programming Spring 2016. Harold, Chapter 8: Sockets for Clients

CISC 4700 L01 Network & Client- Server Programming Spring 2016. Harold, Chapter 8: Sockets for Clients CISC 4700 L01 Network & Client- Server Programming Spring 2016 Harold, Chapter 8: Sockets for Clients Datagram: Internet data packet Header: accounting info (e.g., address, port of source and dest) Payload:

More information

The Java I/O System. Binary I/O streams (ascii, 8 bits) The decorator design pattern Character I/O streams (Unicode, 16 bits)

The Java I/O System. Binary I/O streams (ascii, 8 bits) The decorator design pattern Character I/O streams (Unicode, 16 bits) Binary I/O streams (ascii, 8 bits) InputStream OutputStream The Java I/O System The decorator design pattern Character I/O streams (Unicode, 16 bits) Reader Writer Comparing Binary I/O to Character I/O

More information

Data Communication & Networks G22.2262-001

Data Communication & Networks G22.2262-001 Data Communication & Networks G22.2262-001 Session 10 - Main Theme Java Sockets Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda

More information

Java Programming Unit 10. Stock Price Quotes with URL, Sockets, and RMI

Java Programming Unit 10. Stock Price Quotes with URL, Sockets, and RMI Java Programming Unit 10 Stock Price Quotes with URL, Sockets, and RMI GeFng Stock Quotes From Yahoo! 1. Visit hjp://finance.yahoo.com, enter AAPL - the symbol of the Apple s stock, and press the bujon

More information

INPUT AND OUTPUT STREAMS

INPUT AND OUTPUT STREAMS INPUT AND OUTPUT The Java Platform supports different kinds of information sources and information sinks. A program may get data from an information source which may be a file on disk, a network connection,

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O

CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O 1 Sending Output to a (Text) File import java.util.scanner; import java.io.*; public class TextFileOutputDemo1 public static void

More information

B.Sc (Honours) - Software Development

B.Sc (Honours) - Software Development Galway-Mayo Institute of Technology B.Sc (Honours) - Software Development E-Commerce Development Technologies II Lab Session Using the Java URLConnection Class The purpose of this lab session is to: (i)

More information

Accessing PostgreSQL through JDBC via a Java SSL tunnel

Accessing PostgreSQL through JDBC via a Java SSL tunnel LinuxFocus article number 285 http://linuxfocus.org Accessing PostgreSQL through JDBC via a Java SSL tunnel by Chianglin Ng About the author: I live in Singapore, a modern multiracial

More information

Socket programming. Socket Programming. Languages and Platforms. Sockets. Rohan Murty Hitesh Ballani. Last Modified: 2/8/2004 8:30:45 AM

Socket programming. Socket Programming. Languages and Platforms. Sockets. Rohan Murty Hitesh Ballani. Last Modified: 2/8/2004 8:30:45 AM Socket Programming Rohan Murty Hitesh Ballani Last Modified: 2/8/2004 8:30:45 AM Slides adapted from Prof. Matthews slides from 2003SP Socket programming Goal: learn how to build client/server application

More information

Mail User Agent Project

Mail User Agent Project Mail User Agent Project Tom Kelliher, CS 325 100 points, due May 4, 2011 Introduction (From Kurose & Ross, 4th ed.) In this project you will implement a mail user agent (MUA) that sends mail to other users.

More information

An Overview of Java. overview-1

An Overview of Java. overview-1 An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2

More information

Remote Method Invocation

Remote Method Invocation Remote Method Invocation The network is the computer Consider the following program organization: method call SomeClass AnotherClass returned object computer 1 computer 2 If the network is the computer,

More information

Domain Name System (DNS) Omer F. Rana. Networks and Data Communications 1

Domain Name System (DNS) Omer F. Rana. Networks and Data Communications 1 Domain Name System (DNS) Omer F. Rana Networks and Data Communications 1 What is a DNS Each institution on the internet has a host that runs a process called a Domain Name Server (also DNS!) It is not

More information

String sentence = new String(receivePacket.getData()); InetAddress IPAddress = receivepacket.getaddress(); int port = receivepacket.

String sentence = new String(receivePacket.getData()); InetAddress IPAddress = receivepacket.getaddress(); int port = receivepacket. 164 CHAPTER 2 APPLICATION LAYER connection requests, as done in TCPServer.java. If multiple clients access this application, they will all send their packets into this single door, serversocket. String

More information

File class in Java. Scanner reminder. Files 10/19/2012. File Input and Output (Savitch, Chapter 10)

File class in Java. Scanner reminder. Files 10/19/2012. File Input and Output (Savitch, Chapter 10) File class in Java File Input and Output (Savitch, Chapter 10) TOPICS File Input Exception Handling File Output Programmers refer to input/output as "I/O". The File class represents files as objects. The

More information

TITLE NETWORK PROGRAMMING (SECURED CLIENT-SERVER CHAT APPLICATION) A PROJECT REPORT PRESENTED ACHILE UGBEDE JOHN CE/2007/165

TITLE NETWORK PROGRAMMING (SECURED CLIENT-SERVER CHAT APPLICATION) A PROJECT REPORT PRESENTED ACHILE UGBEDE JOHN CE/2007/165 TITLE NETWORK PROGRAMMING (SECURED CLIENT-SERVER CHAT APPLICATION) A PROJECT REPORT PRESENTED BY ACHILE UGBEDE JOHN CE/2007/165 TO THE DEPARTMENT OF COMPUTER ENGINEERING IN FACULTY OF ENGINEERING CARITAS

More information

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software Session NM059 TCP/IP Programming on VMS Geoff Bryant Process Software Course Roadmap Slide 160 NM055 (11:00-12:00) Important Terms and Concepts TCP/IP and Client/Server Model Sockets and TLI Client/Server

More information

! "# $%&'( ) * ).) "%&' 1* ( %&' ! "%&'2 (! ""$ 1! ""3($

! # $%&'( ) * ).) %&' 1* ( %&' ! %&'2 (! $ 1! 3($ ! "# $%&'( ) * +,'-( ).) /"0'" 1 %&' 1* ( %&' "%&'! "%&'2 (! ""$ 1! ""3($ 2 ', '%&' 2 , 3, 4( 4 %&'( 2(! ""$ -5%&'* -2%&'(* ) * %&' 2! ""$ -*! " 4 , - %&' 3( #5! " 5, '56! "* * 4(%&'(! ""$ 3(#! " 42/7'89.:&!

More information

Threads & Tasks: Executor Framework

Threads & Tasks: Executor Framework Threads & Tasks: Executor Framework Introduction & Motivation WebServer Executor Framework Callable and Future 12 April 2012 1 Threads & Tasks Motivations for using threads Actor-based Goal: Create an

More information

5 HDFS - Hadoop Distributed System

5 HDFS - Hadoop Distributed System 5 HDFS - Hadoop Distributed System 5.1 Definition and Remarks HDFS is a file system designed for storing very large files with streaming data access patterns running on clusters of commoditive hardware.

More information

DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service

DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service Achieving Scalability and High Availability Abstract DB2 Connect Enterprise Edition for Windows NT provides fast and robust connectivity

More information

Corso di Reti di Calcolatori

Corso di Reti di Calcolatori Corso di Reti di Calcolatori UNICAL Facoltà di Ingegneria a.a. 2002/2003 Esercitazione sul networking in Java (1 a parte) paolo.trunfio@deis.unical.it 1 java.net.inetaddress static InetAddress getbyname(string

More information

What is an I/O Stream?

What is an I/O Stream? Java I/O Stream 1 Topics What is an I/O stream? Types of Streams Stream class hierarchy Control flow of an I/O operation using Streams Byte streams Character streams Buffered streams Standard I/O streams

More information

Example of Standard API

Example of Standard API 16 Example of Standard API System Call Implementation Typically, a number associated with each system call System call interface maintains a table indexed according to these numbers The system call interface

More information

MSDG Services Integration Document Draft Ver 1.2

MSDG Services Integration Document Draft Ver 1.2 Table of contents Page 1 of 17 Table of Contents 2 Push SMS Integration 1. 1.1 Overview HTTP API lets departments send across SMS messages using HTTP URL interface. The API supports SMS push (Single SMS

More information

Intel Retail Client Manager Audience Analytics

Intel Retail Client Manager Audience Analytics Intel Retail Client Manager Audience Analytics By using this document, in addition to any agreements you have with Intel, you accept the terms set forth below. You may not use or facilitate the use of

More information

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Agenda. Distributed System Structures. Why Distributed Systems? Motivation Agenda Distributed System Structures CSCI 444/544 Operating Systems Fall 2008 Motivation Network structure Fundamental network services Sockets and ports Client/server model Remote Procedure Call (RPC)

More information

Middleware Lou Somers

Middleware Lou Somers Middleware Lou Somers April 18, 2002 1 Contents Overview Definition, goals, requirements Four categories of middleware Transactional, message oriented, procedural, object Middleware examples XML-RPC, SOAP,

More information

File Sharing. Peter Lo. CP582 Peter Lo 2003 1

File Sharing. Peter Lo. CP582 Peter Lo 2003 1 File Sharing Peter Lo CP582 Peter Lo 2003 1 File Sharing What is it? How is it different from File Transfer How it it done? CP582 Peter Lo 2003 2 This lecture we move away from the topic of transferring

More information

XII. Distributed Systems and Middleware. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

XII. Distributed Systems and Middleware. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini XII. Distributed Systems and Middleware Laurea Triennale in Informatica Corso di Outline Distributed Systems Basics Middleware generalities Middleware for Distributed Objects Distributed Computing Models

More information

OBJECT ORIENTED PROGRAMMING LANGUAGE

OBJECT ORIENTED PROGRAMMING LANGUAGE UNIT-6 (MULTI THREADING) Multi Threading: Java Language Classes The java.lang package contains the collection of base types (language types) that are always imported into any given compilation unit. This

More information

WRITING DATA TO A BINARY FILE

WRITING DATA TO A BINARY FILE WRITING DATA TO A BINARY FILE TEXT FILES VS. BINARY FILES Up to now, we have looked at how to write and read characters to and from a text file. Text files are files that contain sequences of characters.

More information

DNS: Domain Names. DNS: Domain Name System. DNS: Root name servers. DNS name servers

DNS: Domain Names. DNS: Domain Name System. DNS: Root name servers. DNS name servers DNS: Domain Name System DNS: Domain Names People: many identifiers: SSN, name, Passport # Internet hosts, routers: Always: IP address (32 bit) - used for addressing datagrams Often: name, e.g., nifc14.wsu.edu

More information

Cross-platform TCP/IP Socket Programming in REXX

Cross-platform TCP/IP Socket Programming in REXX Cross-platform TCP/IP Socket programming in REXX Abstract: TCP/IP is the key modern network technology, and the various REXX implementations have useful, if incompatible interfaces to it. In this session,

More information

File I/O - Chapter 10. Many Stream Classes. Text Files vs Binary Files

File I/O - Chapter 10. Many Stream Classes. Text Files vs Binary Files File I/O - Chapter 10 A Java stream is a sequence of bytes. An InputStream can read from a file the console (System.in) a network socket an array of bytes in memory a StringBuffer a pipe, which is an OutputStream

More information

Network Attached Storage. Jinfeng Yang Oct/19/2015

Network Attached Storage. Jinfeng Yang Oct/19/2015 Network Attached Storage Jinfeng Yang Oct/19/2015 Outline Part A 1. What is the Network Attached Storage (NAS)? 2. What are the applications of NAS? 3. The benefits of NAS. 4. NAS s performance (Reliability

More information

Apache Thrift and Ruby

Apache Thrift and Ruby Apache Thrift and Ruby By Randy Abernethy In this article, excerpted from The Programmer s Guide to Apache Thrift, we will install Apache Thrift support for Ruby and build a simple Ruby RPC client and

More information

Configuring and Monitoring Hitachi SAN Servers

Configuring and Monitoring Hitachi SAN Servers Configuring and Monitoring Hitachi SAN Servers eg Enterprise v5.6 Restricted Rights Legend The information contained in this document is confidential and subject to change without notice. No part of this

More information

Amoeba Distributed Operating System

Amoeba Distributed Operating System Amoeba Distributed Operating System Matt Ramsay Tim Kiegel Heath Memmer CS470 Case Study Paper 4/19/02 Amoeba Introduction The Amoeba operating system began as a research project at Vrije Universiteit

More information

Logging in Java Applications

Logging in Java Applications Logging in Java Applications Logging provides a way to capture information about the operation of an application. Once captured, the information can be used for many purposes, but it is particularly useful

More information

Agent Languages. Overview. Requirements. Java. Tcl/Tk. Telescript. Evaluation. Artificial Intelligence Intelligent Agents

Agent Languages. Overview. Requirements. Java. Tcl/Tk. Telescript. Evaluation. Artificial Intelligence Intelligent Agents Agent Languages Requirements Overview Java Tcl/Tk Telescript Evaluation Franz J. Kurfess, Cal Poly SLO 211 Requirements for agent Languages distributed programming large-scale (tens of thousands of computers)

More information

41376 UDP performing get device status Command Workstation (CWS), Harmony, Bi-directional Driver 8021-8022 TCP/UDP

41376 UDP performing get device status Command Workstation (CWS), Harmony, Bi-directional Driver 8021-8022 TCP/UDP TCP/IP ports that might be used with Canon office equipment (in alphabetical order) 3/1/2009 Axis Print server. This port is used to identify the status the axis print server. This is performed approx

More information

ELEN 602: Computer Communications and Networking. Socket Programming Basics

ELEN 602: Computer Communications and Networking. Socket Programming Basics 1 ELEN 602: Computer Communications and Networking Socket Programming Basics A. Introduction In the classic client-server model, the client sends out requests to the server, and the server does some processing

More information

Tier Architectures. Kathleen Durant CS 3200

Tier Architectures. Kathleen Durant CS 3200 Tier Architectures Kathleen Durant CS 3200 1 Supporting Architectures for DBMS Over the years there have been many different hardware configurations to support database systems Some are outdated others

More information

Client-Server Applications

Client-Server Applications Client-Server Applications Prof. Sanjeev Setia Distributed Software Systems CS 707 Distributed Software Systems 1 Client Server Systems Distributed Software Systems 2 1 Client/Server Application Distributed

More information

SCUOLA SUPERIORE SANT ANNA 2007/2008

SCUOLA SUPERIORE SANT ANNA 2007/2008 Master degree report Implementation of System and Network Monitoring Solution Netx2.0 By Kanchanna RAMASAMY BALRAJ In fulfillment of INTERNATIONAL MASTER ON INFORMATION TECHNOLOGY SCUOLA SUPERIORE SANT

More information

Connecting to the network

Connecting to the network 5 Connecting to the network This chapter discusses the basic stages of connecting the printer to the network, provides an overview of network requirements and protocol diagrams, and describes how to physically

More information

COSC 6397 Big Data Analytics. Distributed File Systems (II) Edgar Gabriel Spring 2014. HDFS Basics

COSC 6397 Big Data Analytics. Distributed File Systems (II) Edgar Gabriel Spring 2014. HDFS Basics COSC 6397 Big Data Analytics Distributed File Systems (II) Edgar Gabriel Spring 2014 HDFS Basics An open-source implementation of Google File System Assume that node failure rate is high Assumes a small

More information

Lecture 7: Java RMI. CS178: Programming Parallel and Distributed Systems. February 14, 2001 Steven P. Reiss

Lecture 7: Java RMI. CS178: Programming Parallel and Distributed Systems. February 14, 2001 Steven P. Reiss Lecture 7: Java RMI CS178: Programming Parallel and Distributed Systems February 14, 2001 Steven P. Reiss I. Overview A. Last time we started looking at multiple process programming 1. How to do interprocess

More information

AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA

AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA Ms. M. Kiruthika Asst. Professor, Fr.C.R.I.T, Vashi, Navi Mumbai. venkatr20032002@gmail.com Ms. Smita Dange Lecturer,

More information

Remote Method Invocation (RMI)

Remote Method Invocation (RMI) Remote Method Invocation (RMI) Remote Method Invocation (RMI) allows us to get a reference to an object on a remote host and use it as if it were on our virtual machine. We can invoke methods on the remote

More information

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address Objectives University of Jordan Faculty of Engineering & Technology Computer Engineering Department Computer Networks Laboratory 907528 Lab.4 Basic Network Operation and Troubleshooting 1. To become familiar

More information

NetCrunch 6. AdRem. Network Monitoring Server. Document. Monitor. Manage

NetCrunch 6. AdRem. Network Monitoring Server. Document. Monitor. Manage AdRem NetCrunch 6 Network Monitoring Server With NetCrunch, you always know exactly what is happening with your critical applications, servers, and devices. Document Explore physical and logical network

More information

Overview of Web Services API

Overview of Web Services API 1 CHAPTER The Cisco IP Interoperability and Collaboration System (IPICS) 4.5(x) application programming interface (API) provides a web services-based API that enables the management and control of various

More information

EVALUATION OF TOOLS FOR CYBER SECURITY

EVALUATION OF TOOLS FOR CYBER SECURITY Project report 2: EVALUATION OF TOOLS FOR CYBER SECURITY By Piyali Basak Indian Institute of Technology, Kanpur Guided by Dr. N.P. Dhavale Deputy General Manager, Strategic Business Unit, Institute for

More information

presentation DAD Distributed Applications Development Cristian Toma

presentation DAD Distributed Applications Development Cristian Toma Lecture 5 S2 - Summary of Network Protocols Programming in JSE for Distributed Systems Section 2 presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department of Economic

More information

JAVA - MULTITHREADING

JAVA - MULTITHREADING JAVA - MULTITHREADING http://www.tutorialspoint.com/java/java_multithreading.htm Copyright tutorialspoint.com Java is amulti threaded programming language which means we can develop multi threaded program

More information

13 File Output and Input

13 File Output and Input SCIENTIFIC PROGRAMMING -1 13 File Output and Input 13.1 Introduction To make programs really useful we have to be able to input and output data in large machinereadable amounts, in particular we have to

More information

Network Programming TDC 561

Network Programming TDC 561 Network Programming TDC 561 Lecture # 1 Dr. Ehab S. Al-Shaer School of Computer Science & Telecommunication DePaul University Chicago, IL 1 Network Programming Goals of this Course: Studying, evaluating

More information

Objectives of Lecture. Network Architecture. Protocols. Contents

Objectives of Lecture. Network Architecture. Protocols. Contents Objectives of Lecture Network Architecture Show how network architecture can be understood using a layered approach. Introduce the OSI seven layer reference model. Introduce the concepts of internetworking

More information