Forums Register Login

socket programming

+Pie Number of slices to send: Send
how to Sort the integers from a client process into ascending order and then send
the sorted numbers back to the client through a message queue.
+Pie Number of slices to send: Send
Welcome to the JavaRanch, muthoju. We love to talk all things Java here but we get our fair share of people asking us to do their homework for them. We ask that you at least make an effort at writing some code and ask some specific questions. Try starting with sending and receiving information. The Java Tutorial on Custom Networking is a good place to start with sockets.
+Pie Number of slices to send: Send
while establishing connection with server,getting the localhost address i did
try {
InetAddress here = InetAddress.getLocalHost ();
hostname = here.getHostName ();
logDisplay.append ( "host = "+hostname+"\n" );
}
catch (UnknownHostException e) { ;}
is this the coorect approach
+Pie Number of slices to send: Send
 

Originally posted by muthoju haritha:
while establishing connection with server,getting the localhost address i did
try {
InetAddress here = InetAddress.getLocalHost ();
hostname = here.getHostName ();
logDisplay.append ( "host = "+hostname+"\n" );
}
catch (UnknownHostException e) { ;}
is this the coorect approach



This is a start since it means you are looking at some of the methods available in the Java API. Now you need to figure out how to create the client and server processess. The client process will somehow obtain a list of numbers to send to the server. The server will accept the client's connection, recieve the numbers, sort them, and send them back.

Notice how I have briefly describe the tasks involved. This is typically a good place to start with any computer program, even non-networked ones. Now you will need to find the right APIs that will allow you to carry out each task.

Layne
Yeah, but is it art? What do you think tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 912 times.
Similar Threads
html code to webpage
database connection
Print invoice - JSP
Printing contents
what exception will be thrown CMT?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 02:15:19.