I changed my code to the following, and now it appears to be working. However, I'm sure there's probably still something wrong with it... *sighs*
package stuff;
import java.net.*;
import java.io.*;
public class Client1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Socket echoSocket = null;
PrintWriter out = null;
BufferedReader in = null;
try{
int port = 1235;
String hostname = "localhost";
Socket connectionSock = new Socket(hostname, port);
out = new PrintWriter(connectionSock.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(
connectionSock.getInputStream()));
out.println("Print this message Mr. server");
out.println("Print this other message Mr. server");
}catch (Exception e){}
}
}