Client & Server JAVA Program - Printable Version +- (wL) Forums (https://war-lords.net/forum) +-- Forum: Resources (https://war-lords.net/forum/forum-31.html) +--- Forum: Programming (https://war-lords.net/forum/forum-33.html) +--- Thread: Client & Server JAVA Program (/thread-98.html) |
Client & Server JAVA Program - Canister - Apr 17 2010 Okay so I was looking at a source code written for a java client and server. The client sends information to the server and the server picks up the info. I took out the main parts of both classes so here they are... Import the following: import java.io.*; import java.net.*; import java.util.*; // You need this only for the server class Client side: PHP Code: //First create a socket connection to the server we will run: PHP Code: Socket skt = new Socket(host,port); PHP Code: //For the server you must create a server socket and communicate to the client. PHP Code: ServerSocket myServerSocket = new ServerSocket(port); This is easy as hell and if you understand this you can understand the concept between internet communication. Mostly everything from surfing the web to gaming online has a sort of system like this. Also if you can fully understand this then you know what other naughty things you can do with it . To sum it up the client creates a socket that has an input stream and output stream that sends and receives information from the server. The server waits for information to be sent and then decides on the reply that you have specified. If you have any questions just reply RE: Client & Server JAVA Program - leet - Apr 17 2010 cool story bro, literally. just imagine... all the possibilities, THEY ARE ENDLESS! RE: Client & Server JAVA Program - Dre@m$ - Jun 30 2011 is java worth leaning cuz i want to learn a programming lang RE: Client & Server JAVA Program - MindHACKer - Oct 19 2011 Dre@m$ Wrote:is java worth leaning cuz i want to learn a programming langIt's Great, but i would really recommend C#, it's a lot more Powerful on windows, and looks very much alike Java, so you can switch easily when u want to. |