wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes socket programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "socket programming" Watch "socket programming" New topic
Author

socket programming

muthoju haritha
Greenhorn

Joined: Dec 08, 2005
Posts: 2
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.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
muthoju haritha
Greenhorn

Joined: Dec 08, 2005
Posts: 2
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
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: socket programming