d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Multithreading Server Application > Need Someone Who Can Screenshare
Prev12
Add Reply New Topic New Poll
Member
Posts: 23,502
Joined: Aug 3 2011
Gold: 6,921.00
Mar 18 2018 09:41pm
Quote (waraholic @ Mar 18 2018 07:48pm)
What do you mean by terminal? Why do I keep asking questions when I'm not getting any good answers?


Terminal as in unix, you SSH into a server. You use the javac command to compile all the java files. You have a server + client. I'm not sure where the confusion is unless you haven't worked in the networking area before?
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Mar 19 2018 04:31pm
Quote (Cocoo @ Mar 18 2018 10:41pm)
Terminal as in unix, you SSH into a server. You use the javac command to compile all the java files. You have a server + client. I'm not sure where the confusion is unless you haven't worked in the networking area before?


I thought perhaps you didn't know what a terminal was since this makes no sense to do through one imho.
Member
Posts: 23,502
Joined: Aug 3 2011
Gold: 6,921.00
Mar 20 2018 04:16pm
Quote (waraholic @ Mar 19 2018 03:31pm)
I thought perhaps you didn't know what a terminal was since this makes no sense to do through one imho.


It makes sense if you're learning :O I get there are programs out there but what will I learn if I don't hard code it ya know?!?
Member
Posts: 1,086
Joined: Aug 28 2016
Gold: 6,190.00
Apr 5 2018 02:09pm
Man all of these people not even trying to help you.

So first things first you need to understand Networking...
Here is how a server works
A server is just a computer listening on a specific port for a message.

A client
Is someone connecting to that computer's ip and port.

If this is done on local host, you can use ip 127.0.0.1 or "localhost"
and any port, however there are some reserved ports and most people use 8080 for local testing.


For java your server needs an input stream and an outputstream, inputstream takes the outputstream from the client and vise versa...

A common problem when trying to setup your client and server in java is you will have a deadlock(infinite wait) on getting inputstream and outputstream on clientside if you put the order wrong compared to your servers order.

I agree with people suggesting Nodejs, that is because Nodejs is built for running a server and you can use the WebSocket library.

Take a look at this echo server
I'm not allowed to post links look up on github.. basically github/
manotoor/CS380_01_ClientServer
Member
Posts: 16,621
Joined: Jan 7 2017
Gold: 90.58
Apr 6 2018 03:39am
Quote (Gohantrades @ Apr 5 2018 12:09pm)
Man all of these people not even trying to help you.

So first things first you need to understand Networking...
Here is how a server works
A server is just a computer listening on a specific port for a message.

A client
Is someone connecting to that computer's ip and port.

If this is done on local host, you can use ip 127.0.0.1 or "localhost"
and any port, however there are some reserved ports and most people use 8080 for local testing.


For java your server needs an input stream and an outputstream, inputstream takes the outputstream from the client and vise versa...

A common problem when trying to setup your client and server in java is you will have a deadlock(infinite wait) on getting inputstream and outputstream on clientside if you put the order wrong compared to your servers order.

I agree with people suggesting Nodejs, that is because Nodejs is built for running a server and you can use the WebSocket library.

Take a look at this echo server
I'm not allowed to post links look up on github.. basically github/
manotoor/CS380_01_ClientServer




post #2 is all the info he needs. i helped answer his question just fine, no need to shame me

This post was edited by JohnMiller92 on Apr 6 2018 03:40am
Member
Posts: 36,123
Joined: Jul 18 2008
Gold: 2,407.00
Apr 20 2018 07:28am
I've done a similar project in Java before (that I never finished *cough*).

What part is giving you trouble?

The way I accomplished it was to set up my server socket, wait for connections, and when I received a connection I would pass that socket object to a class that implemented Runnable to process that connection in its own thread.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll