Jeedi Jed wrote:
i need to know that y this so...moreover how should i manage to run both programs on same machine to get client-server comm....
Jeedi Jed wrote:Sorry to say THE count of VIEWS is increasing minutes to minutes but no suggestion/guidance
Richard Tookey wrote:
Jeedi Jed wrote:Sorry to say THE count of VIEWS is increasing minutes to minutes but no suggestion/guidance
Maybe nobody is responding because, like me, when they test your code it works with no exception thrown.
P.S. It is not the cause of your problem but you just need
Jeedi Jed wrote:
Richard Tookey wrote:
I dont know how to make a connection b/w these two programs on the same machine....also i want to remove this exception it comes again and again
Start the server running in one command window. Run the client in a second command window. Worry about the exception when you have the client-server pair basically working.
Richard Tookey wrote:
Jeedi Jed wrote:
Richard Tookey wrote:
I dont know how to make a connection b/w these two programs on the same machine....also i want to remove this exception it comes again and again
Start the server running in one command window. Run the client in a second command window. Worry about the exception when you have the client-server pair basically working.
But when i ran the client part it returned an error pointint to:
also returning NullPointerException
For running Server part it returns:
Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unkno wn Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at Socket.main(Socket.java:13)
Its driving me mad now as i am too slow now because of this bug!!!
Jeedi Jed wrote:
For running Server part it returns:
Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
Richard Tookey wrote:
Jeedi Jed wrote:
For running Server part it returns:
Exception in thread "main" java.net.BindException: Address already in use: JVM_Bind
As the exception indicates and has already been said by others, port 1254 is already being used by another process! Use a different port! Choose a port above 1023 since 0-1023 are reserved for 'well known' services. Until you stop getting that server exception there is no point in running your client.
Note - the NullPointerException from your client adds additional evidence that port 1254 is already in use since it means your client is connecting with it but not able to read the string.
Richard Tookey wrote:Your code works for me but I have taken it as a starting point and removed the redundant parts, changed the server class name, tried to make sure it binds to the correct interface ( localhost ), picks up the correct library classes and made the server loop forever accepting connections.. The exception handling is at best rudimentary but it works for me on both Linux and Windows 7 .
If this does not work on your system then I have to assume you have a network configuration problem.
Bear Bibeault wrote:"Jeedi Jed", please check your private messages for an important administrative matter. Thanks.