Project socket programming - udp objectives - learn socket

Assignment Help JAVA Programming
Reference no: EM13346645

Project: Socket Programming - UDP

Objectives:

- Learn socket programming in Java: UDP

-  Cement your understanding of reliable transfer protocols

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

Overview

This framework provides:

-  a template for the reliable transfer protocol implementation.

-  a testing framework, with a graphical user interface.

How to use the testing framework later in the project description.

The main goal of this project is to implement a Stop-and-wait reliable transfer protocol based on the provided template.

-  MyDataPacket,
-  MyAckPacket,
-  MyServerSocket and  
-  MySocket

The former two classes are used to handle data and ack packets, respectively. They are fully implemented. Implement the latter two classes, i.e., MyServerSocket and MySocket. These classes have the following interface:

class MySocket
{
    public MySocket(InetAddress IPAddress, int portNumber)
 
    public OutputStream getOutputStream()
}
 
class MyServerSocket
{
    public MyServerSocket(int port)
 
    public InputStream getInputStream()
}

These classes are quite similar to the TCP sockets available in Java: Socket and ServerSocket. Therefore, we make a few simplifications:

-  No connection-level multiplexing. We assume that only one client at a time connects to a MyServerSocket open at a given port. Therefore, MyServerSocket has no accept method.

Furthermore, we are not going to implement any mechanisms for opening or closing of connections.

-  Unidirectional transfer. Our sockets implement transfer of data in one direction only. To send data, MySocket must be used. To receive data, MyServerSocket is used.

Consequently, there is no getInputStream in MySocket and no getOutputSteam in MyServerSocket

A benefit of the above interface is that we can use it with all the familiar stream classes available in Java, such as DataOutputStream or BufferedReader. An example program that would use our sockets can look as follows:

// Sender (Client)
    ...
    MySocket socket = new

MySocket(InetAddress.getHostByName("somhostname.edu"), 12345);

    DataOutputStream out = new DataOutputStream(socket.getOutputStream());

    out.writeBytes("Hello world!");
    ... 

// Receiver (Server)
    ...

    MyServerSocket serverSocket = new MyServerSocket(12345);

    BufferedReader in = new BufferedReader(new

InputStreamReader(serverSocket.getInputStream()));

    String sentence = in.readLine();

    System.out.println("Received: " + sentence);
    ...

Reference no: EM13346645

Questions Cloud

The users will use a browser to access the on-line store : the users will use a browser to access the on-line store. the web server software for the production web server is
Structural modelingstructural modeling is a different view : structural modelingstructural modeling is a different view of the same system that you analyzed from a functional
Q1a express the shannon-hartley capacity theorem in terms : q1a express the shannon-hartley capacity theorem in terms of where is the energybit and is the psd of white
Recursive tree algorithmsalgorithms to write1 write a : recursive tree algorithmsalgorithms to write1. write a recursive function to determine if a binary tree is a binary
Project socket programming - udp objectives - learn socket : project socket programming - udp objectives - learn socket programming in java udp-nbsp cement your understanding of
Create a web site for an apple farm john smith has been a : create a web site for an apple farm. john smith has been a farmer for a number of years and he has been using an
Stock market project1 building portfolionbsp select five : stock market project1. building portfolionbsp select five companies for the purpose of tracking the stock market
Shopping cart program for web applications classpurpose - : shopping cart program for web applications classpurpose - allows user to browse while keeping track of the items in
Consider the following data for abc enterprises all numbers : consider the following data for abc enterprises all numbers in euro today is january 1 2013 income statement for 2012

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the account number and balance for N bank customers.

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  List data structures to be used in solution

write a program that will prompt the user for an input file name to read from. The Input file will consist of records made up of first name, last name and an account balance of individuals and store the individuals in an ArrayList.

  Write a java program to read the numbers from the disk file

Write a Java program to read the numbers from the disk file and store them in an integer array ( not an ArrayList ).

  Negatively impacting health care currently

Identify and explain at least two events that are negatively impacting health care currently. Tell us why you think these items are negatively impacting the access to care, and make sure that you cite your references.

  Create a file that contains your favorite movie quote

Create a file that contains your favorite movie quote. Use a text editor such as Notepad, and save the file as quote.txt. Copy the file contents,

  Sorting routine adopted in the java api for arrays.sort()?

What is the sorting routine adopted in the Java API for Arrays.sort()? How different is it from the sorting routine we discussed in class? Is it better? Explain your answers in short clear sentences.

  Chat monitoring system

The name of the project is chat monitoring system. in the file you will see the screenshot diagram 2A are my design, i want it to be upgrade, to look professional like the diagram 2B. please java, netbeans and GUI. please can I have only the client s..

  Dijikstra for undirected graph using simple scheme

Dijikstra for undirected graph using simple scheme with array and fibonacci heap and compare the performance/results, preferably in java.

  Write java program to read present basic hourly wage

Write down a java program which will input 1. Read present basic hourly wage. Read in workers fist name and socond name.

  Develop class which implements interface

Let the ADT called SquareMatrix. (The matrix can be represented by 2-D array of ints w/ n rows and n columns.) Write specification for ADT as Java interface. Develop the class which implements interface.

  Use a loop to allow a user to enter a series of numbers

Use a loop to allow a user to enter a series of numbers and then print out the series of numbers when the user is done. The user stops the lseries program by entering -1 (or any negative number).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd