I need to run a server side program such that it will run in background and wait for the client message. and at client side i need to send a message to server. and at server depending on the message i got from the client i need to run a piece of code.
I don't know much of socket programming i will be thankful if any one can post a sample code or else any link to the sample code.
thanking you in advance,
Varun Narisetty
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
posted
0
I understand that you are looking for code directly... but I'd recommend you try doing it by yourself.. here are the hints.
1) ServerSocket is a java class which can create a socket (IP/Port combination) in the server, and keep listening for incoming packets.
2) Socket is another java class which can communicate to any other socket or serversocket.
1) I think you don't know much of socket programming you will be thankful if any one can post a sample code or else any link to the sample code in formus.
2)you need to run a server side program such that it will run in background like THREADS and wait for the client message.
3)At client side you need to send a message to server through protocals either TCP or UDP/WI-FI
4) At server depending on the message you got from the client you need to run a piece of code in background process.
For code visit www.kickadz.com
Prematho,
Mee muddhula anna
vani golakoti
Ranch Hand
Joined: May 27, 2010
Posts: 31
posted
0
Hi Dawn,
How to establish connection between different machines other than local host through socket programming.
Regards,
Bhavani.G
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
vani golakoti wrote:How to establish connection between different machines other than local host through socket programming.
If the method explained in the link I posted doesn't work for you for some reason, then you should tell us *why* that is. It is the standard approach, after all.