updated to have main methods for the server and client

#story[778, 782]
main
hba56 9 years ago
parent 43af929701
commit b5bd1c9d6d

@ -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();

@ -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;

Loading…
Cancel
Save