• Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent Help required  RSS feed

 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am trying to develop an application (using Java) in which there will be 2 programs running.
1. Server Program - This can reside on more than 1 server machines and will listen for client requests.
2. Client Program - This will reside on my PC and will select 1 server machine at a time and will send a request to the server program running
on that server machine.
Here, O.S. of any of the machines could be anything windows or solaris. Client request can be simple request, e.g. client will send some
command that should be run on the server machine and server should return the result of the command. Initially command can be simple as "ls -al" on solaris.
Once the application is successful, then in next phase it should connect to the server machines behind firewall.
Now, I have 2 approches to do this.
1.
-write ServerSocket and run it on Server.
-write Socket to connect to ServerSocket
- after the conn is established, client will send a request and will get the result

2.
-write RMI Server to accept the client request and run it on server
-write RMI client to connect to the server
-call remote methods to get the output of the commands. here also commands are sent as parameters to the remote method

I am confused about the which approach I should go for ? Or are there any other approaches ?
I think RMI would be better as it would handle the Serialization part by itself. Any clues/ suggestions are welcome.
Thanks,
Sachin
 
raimondas zemaitis
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First option is about opening a DATA CHANNEL for data transmission. Received data would need to be interpreted in order to take appropriate action.
Second option is about invoking remote procedure, which in described scenario is much closer to required.
However, you say you will need to travel across firewalls and neither of these can do that without special effort (RMI tunneling and alike).
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Urgent Help required" - that is a totally useless title for your post. Please put some thought into titles so that readers can decide whether or not to use valuable time to look at your post.
"Need help with client-server design" would have been good.
Bill
 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:
"Urgent Help required" - that is a totally useless title for your post. Please put some thought into titles so that readers can decide whether or not to use valuable time to look at your post.
"Need help with client-server design" would have been good.
Bill

See BILL, my need was urgent and so the subject of my Post was. User can very well decide after reading the post to reply or not ?
Some help from your side with this comment would have been more appreciated.
Sachin
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help is precisely what I was trying to supply. In this case, helping you to understand how to get the best results out of the JavaRanch forums, and for that matter, all discussion forums everywhere.
 
Perryn Fowler
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmmm - is this 'Urgent' because your SJCD exam is coming up soon by any chance?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!