d2jsp
d2jsp Forums > Programmer's Haven > Java, Visual Basic, VBScript > Multithreading Server Application > Need Someone Who Can Screenshare
Prev12
Add Reply New Topic New Poll
Cocoo
#11 Mar 18 2018 09:41pm
Group: Member
Posts: 19,189
Joined: Aug 3 2011
Gold: 1,448.50
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?
waraholic
#12 Mar 19 2018 04:31pm
Group: Member
Posts: 934
Joined: Jul 8 2008
Gold: 609.50
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.
Cocoo
#13 Mar 20 2018 04:16pm
Group: Member
Posts: 19,189
Joined: Aug 3 2011
Gold: 1,448.50
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?!?
Gohantrades
#14 Apr 5 2018 02:09pm
Group: Member
Posts: 810
Joined: Aug 28 2016
Gold: 3,902.00
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
JohnMiller92
#15 Apr 6 2018 03:39am
Group: Member
Posts: 14,321
Joined: Jan 7 2017
Gold: 38.00
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
Mastersam93
#16 Apr 20 2018 07:28am
Group: Member
Posts: 35,592
Joined: Jul 18 2008
Gold: 2,446.00
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 Java, Visual Basic, VBScript Topic List
Prev12
Add Reply New Topic New Poll