Client not able to send messages to server in java chat program?

You get the output because you are using the wrong variables. The variable you should print from the server is s1 and not s. Variable s refers to the socket, that's why you are getting the socket info instead of the client's response s1=cin.readLine(); if (s1.

EqualsIgnoreCase("END")) { cout. Println("BYE"); break; } System. Out.

Print("Client : "+s1+"\n"); // note that this should be s1 and not s As a good practice, you should name your variable clearly so you and others can always read the code. Having s, s1 and so on will just get you confused later as the code gets larger. It's also a good habit to have and make other engineers who are working with you happier :).

Without showing any code, it's next to impossible to tell. Please post some. However, the address 0.0.0.0 looks suspicious.

If you're working off of localhost, try 127.0.0.1.

I posted the code..can you run and tell me why is the problem coming coz from server side I am able to send the messages properly but from client side the exception comes – Parth_90 Aug 21 at 4:10 I am using 127.0.0.1 only ..still I am getting the problem – Parth_90 Aug 21 at 4:11.

You get the output because you are using the wrong variables. The variable you should print from the server is s1 and not s.

Without showing any code, it's next to impossible to tell. Please post some.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions