Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocsf phase2 #28

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Ocsf phase2 #28

wants to merge 11 commits into from

Conversation

ShaanBhoi
Copy link

Shaan Bhoi
300037516
SEG 2105 Z-[XX]
[email protected]
Assignment 01
Univeristy of Ottawa

implemented the following changes to to the original repo of the phase 1

E1: Setuped the environment for the assignment
E2: Compiled original repo
E3: Initial testing of original repo for phase 1 tests
E4: Made all changes to git hub branch repo OcsfPhase2

E5 :
Client Side:
Modified the client so it responds to the shutdown of the server by printing a message saying the server has shut down, and quitting. Modified the client so that it obtains the port number from the command line

Server Side:
	Modified the server so that it prints out a nice message whenever a client connects or disconnects

E6:
Client Side:
Implemented the following commands for the client :
i) #quitCausestheclienttoterminategracefully.Makesuretheconnectiontothe server is terminated before exiting the program.
ii) logoff Causes the client to disconnect from the server, but not quit.
iii) #sethost Calls the setHost method in the client. Only allowed if the client is logged off; displays an error message otherwise.
iv) #setport Calls the setPort method in the client, with the sameconstraints as #sethost.
v) #login Causes the client to connect to the server. Only allowed if the client is not already connected; displays an error message otherwise.
vi) #gethost Displays the current host name.
vii) #getport Displays the current port number.

Server Side:
	Added a new class you can call ServerConsole that also implements the ChatIF interface. Following the modifications, the following :
		i) Anything typed on the server’s console by an end-user of the server should be echoed to the server’s console and to all the clients.
		ii) Any message originating from the end-user of the server should be prefixed by the string "SERVER MSG>".


	Added a mechanism so that the user of the server can type commands that perform special functions. Implemented commands specified as follows:
		i) #quitCausestheservertoquitgracefully.
		ii) #stop Causes the server to stop listening for new clients.
		iii) #close Causes the server not only to stop listening for new clients, but also to
		disconnect all existing clients.
		iv) #setport <port> Calls the setPort method in the server. Only allowed if
		the server is closed.
		v) #start Causes the server to start listening for new clients. Only valid if the
		server is stopped.
		vi) #getport Displays the current port number.	

E7:
Client Side:
Implemented a basic mechanism by which clients have a ‘login id’ that is known both to the client and the server

	Added a new ‘login id’ command line argument to the client. This should be the first argument, before the host name and port, because the host name and port are optional in the sense that if they are omitted, defaults are used. The login id should be mandatory; the client should immediately quit if it is not provided.

	Whenever a client connects to a server, it should automatically send the message ‘#login <loginid>’ (i.e. the string #login with the login id appended to it) to the server. 


Server Side:
	 Arrangeed for the server to receive the #login <loginid> command from the client. It behaves according to the following rules:
		i) The #login command should be recognized by the server. Design hint: Modify handleMessageFromClient so it does more than just echo messages.
		ii) The login id should be saved, so the server can always identify the client. Design hint: use the setInfo method to set the login id and the getInfo method to retrieve it again later.
		iii) Each message echoed by the server should be prefixed by the login id of the client that sent the message.
		iv) The#logincommandshouldonlybeallowedasthefirstcommandreceived after a client connects. If #login is received at any other time, the server should send an error message back to the client.
		v) If the #login command is not received as the first command, then the server should send an error message back to the client and terminate the client’s connection. Hint: use the method called close found in ConnnectionToClient.

….java for the methods : connectionClosed , connectionException , and connectionEstablished.
…java for the methods: clientConnected , clientDisconnected, and clientException
…, need to repull original repo to redo phase 1 tests that are in the file PHASE2TestCases and copy/past log info in it
reformatted nameplate and aded specificity for cases I can't complete tests for
same as phase 2 cases but for phase 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant