Hi I have a networking issue between my two programs. I believe the issue is in the Java Server.
At the moment they connect but a message isn't sent between even though both programs seem to be working fine. They both wait for a reply. They both compile and don't crash, they both just hang waiting for each other. I think the problem is in my Java code. Here is the connection method and where it hangs:
The Server waits on the last "System.out.println(in.readLine());", and the client is still waiting for the message from the Server.Code:public void connect() throws IOException
{
try
{
// Create server socket on specified port
// to wait for client requests
mySocket = new ServerSocket(4000);
}
catch (IOException e)
{
System.err.println("IO exception on port");
System.exit(1);
}
System.out.println("Server Socket set up, waiting for call");
try
{
// Wait here for the client request
// Returns a normal socket
clientSocket = mySocket.accept();
}
catch (IOException e)
{
System.err.println("Could not accept incoming call");
System.exit(1);
}
System.out.println("Incoming Call Accepted");
PrintWriter out = new PrintWriter(
clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(
new InputStreamReader(clientSocket.getInputStream()));
String inputLine, outputLine;
out.println("Welcome");
System.out.println(in.readLine());
}
Can anyone see any mistakes?

