![]() |
|
[Java] Advancing with Sockets - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Advancing with Sockets (/showthread.php?tid=6090376) |
Advancing with Sockets - MightyOne - Jun 26, 2020 Hey guys! I have made a topic here in the past regarding server and how to connect to one using java programs i'm coding. So i have made the following codes: Server: (Click to View) Client: (Click to View) I have a few questions i would love to get some help and guidance with!
Thanks for the help! it is very appreciated <3 RE: Advancing with Sockets - yumidev - Jun 26, 2020 1. Just get a cheap ass VPS 2. Use any open on the server and preferably not one reserved by another service 3. Accept them in a loop. Also for better approach - use something like Netty for nice server pipeline and easy non-blocking i/o. Also refrain from using object serialization, make a custom binary protocol or just use Jackson+JSON encoding or whatever else, object serialization theoretically might lead to RCE. 4. Socket#getInetAddress() / Socket#getRemoteSocketAddress() RE: Advancing with Sockets - MightyOne - Jul 2, 2020 (Jun 26, 2020 05:41 PM)yumidev Wrote: 1. Just get a cheap ass VPS Thanks for answering pal ! i saw your post and went straight to work on it. didn't notice i didnt actually reply so im updating here. 1. tried looking on a few, couldn't manage to make the .java file of the server run on any of them though. unfortunately :\ 2. Thanks ! :) 3. So just throw the entire Server constructor code inside a while loop without a real ending loop? so it will continually open another server when sent back a response? wont it cause any overload? or is it just the proper way to go? Unfortunately im not aware of using Jackson nor JSON or any encoding at the moment.. nor serialization ;P i still have a lot more to learn.. 4. Thanks ! it seems to be working (As i get the local IP obviously) . once ill manage to put the Server code on a VPS or something ill try again to see if i get different dynamic IP's. If there's anyone more familiar with how to upload the JAVA class onto a server i would be REALLY happy! |