Forums Register Login

How I'm support to run a server with a client in java?

+Pie Number of slices to send: Send
As the question is asking above
I have this program for server:

and this one for client:


by the way I'm using eclipse.
when I run the server is fine but when run the client, its crash any idea why is not working ??

crash.JPG
server-client
[Thumbnail for crash.JPG]
1
+Pie Number of slices to send: Send
The only array retrieval is on line 3 of your posted client code, so I suspect that you're not passing an argument in.
1
+Pie Number of slices to send: Send
In my version of Eclipse, you can add a program argument by creating a Run Configuration. Run -> Run Configurations..., select or create a configuration, click the Arguments tab.
+Pie Number of slices to send: Send
 

Knute Snortum wrote:In my version of Eclipse, you can add a program argument by creating a Run Configuration. Run -> Run Configurations..., select or create a configuration, click the Arguments tab.

what I'm support to put on the argument tab, client?
1
+Pie Number of slices to send: Send
Did you write this?

args is an array of argument that are usually passed from the command line. By looking at the documentation it seems you need an Internet address.
+Pie Number of slices to send: Send
 

Knute Snortum wrote:Did you write this?

args is an array of argument that are usually passed from the command line. By looking at the documentation it seems you need an Internet address.



like this ?

I guess i need find IP using the command prompt
client.JPG
[Thumbnail for client.JPG]
1
+Pie Number of slices to send: Send
Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?
+Pie Number of slices to send: Send
 

Knute Snortum wrote:Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?


you mean the IP numbers on the Arguments>
+Pie Number of slices to send: Send
 

jin Otanashi wrote:

Knute Snortum wrote:Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?


you mean the IP numbers on the Arguments>



got it and already fixed thank you so much

working.JPG
[Thumbnail for working.JPG]
+Pie Number of slices to send: Send
You're welcome.
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2628 times.
Similar Threads
client server gui
Not Sure
Problem: (Simple program) server doesn't display/read message from client!?
Socket : MultiClient Server
A simple proxy - problem returning response data to the client
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:11:50.