File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Networking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Networking" Watch "Networking" New topic


Tim Adam Cooper

Joined: Jul 29, 2002
Posts: 17
I am currently learning about Networking and Sockets to prepare for my Sun Java Development exam.
Below is a scenairo about networking:
If a company has five computers all connected via a network as below:
Computer´┐Żs Name Type of Computer
Comp1 Windows NT Server
Comp2 Windows NT Server
Comp3 Windows NT Workstation
Comp4 Windows NT Workstation
Comp5 Windows NT Workstation

Below is a program that uses a ServerSocket class to create a Server:
public class SimpleServer {
public static void main(String args[]){
ServerSocket s = null;
Socket s1;
String sendString="Hello from the Server";
OutputStream slout;
DataOutputStream dos;
s=new ServerSocket(5432);
System.out.println("Server ready");
}catch(IOException e){}
dos=new DataOutputStream(slout);
}catch(IOException e){}
The question that I would like to ask is must the Server program above be placed in a Server computer (Comp1 and Comp2) or is it OK to put the Server program in a Workstation (Comp3, Comp4 and Comp5) and the Workstation can acts as a server? So for example, can I put the Server program in Comp3 (Workstation) so that Comp3 can acts as a Server to Comp4 (Workstation) and Comp5 (Workstation) ?
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

You can run your server program anywhere u want, including workstations. What's more, u can even run ur server and client on the same machine.
- Manish
I agree. Here's the link:
subject: Networking
It's not a secret anymore!