updated to have main methods for the server and client

#story[778, 782]
This commit is contained in:
hba56
2017-04-19 15:04:29 +12:00
parent 43af929701
commit b5bd1c9d6d
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -7,12 +7,14 @@ import java.net.*;
*/
public class TCPClient
{
public static void startClient() throws Exception
public static void main(String argv[]) throws Exception
{
String sentence;
String modifiedSentence;
BufferedReader inFromUser = new BufferedReader( new InputStreamReader(System.in));
Socket clientSocket = new Socket("localhost", 6789);
//socket port 4942 as 4940 is ac35 live port and 4941 is ac35 test port
Socket clientSocket = new Socket("localhost", 4942);
DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
sentence = inFromUser.readLine();
+1 -1
View File
@@ -7,7 +7,7 @@ import java.net.*;
*/
public class TCPServer
{
public static void startServer() throws Exception
public static void main(String argv[]) throws Exception
{
String clientSentence;
String capitalizedSentence;