Skip to content
Snippets Groups Projects
Commit 5d1210f2 authored by John Furr's avatar John Furr
Browse files

Homework 1 requirements and homework two UML diagram (I need a life and a burger).

parent 313cca5c
No related branches found
No related tags found
No related merge requests found
package MV3500Cohort2018JulySeptember.homework1;
import java.io.*;
import java.net.*;
/**
* The simplest possible TCP network program. It listens for
* a connection, from telnet (telnet localhost 2317) or a program
* you write, which we will do later. Right now the TcpExample simply
* writes a string in response to a connection.
*
* Testing the running server program from telnet looks like this:
*
* it154916:projects mcgredo$ telnet localhost 2317
* Trying ::1...
* Connected to localhost.
* Escape character is '^]'.
* This was written by the server
* Connection closed by foreign host.
*
* Notice that "This was written by the server" matches
* what is written by the code below, over the output stream.
*
* After this first connection the program below drops out
* the bottom of the program, and does not repeat itself.
* The program exits.
*
* @author mcgredo
*/
public class FurrAssignment1
{
public static void main(String[] args)
{
try
{
// The ServerSocket waits for a connection from a client.
// It returns a Socket object when the connection occurs.
ServerSocket serverSocket = new ServerSocket(2317);
// The Socket object represents the connection between
// the server and client, including a full duplex
// connection
Socket clientConnection = serverSocket.accept();
// Use Java io classes to write text (as opposed to
// unknown bytes of some sort) to the client
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This client response was written by server FurrAssignment1"); // to remote client
System.out.println("This server response was written by server FurrAssignment1"); // to server console
ps.println("Thanks for showing up it's been fun, but you have to go now. Goodbye!"); //added a goodbye message, it really has been fun!
// "flush()" in important in that it forces a write
// across what is in fact a slow connection
ps.flush();
clientConnection.close();
}
catch(Exception e)
{
System.out.println("problem with networking: " + e);
}
}
}
package FurrAssignment2;
package MV3500Cohort2018JulySeptember.homework1;
import java.io.*;
import java.net.*;
......
File added
projects/Assignments/2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg

376 KiB

File added
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "Assignments__MV3500_Homework.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment