• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sockets -- SCJD -- Is there anybody who used ?  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm using Sockets for the network configuration in the FBN assignment.
Now I have
1. DataServer ... which makes a server which can accept multiple connections and process requests by calling the appropriate methods of the Data class.
2. DataClient... which connects to the DataServer using the specified port and host and which communicates with the DataServer on behalf of the client.
My Dataclass object is a Singleton on Server side (much like a single database which is queried and manipulated ny multiple clients!) I prefer this coz it sounds more meaningful than to have multiple copies of the Data class object and each client operating on its own copy !!!
The specification says that
" To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration. "
So, if I have to give the client the ability to use all the methods in the Data class, then could you please throw some light on how to proceed with that using sockets.?
My intention is that when client calls a method on the data object it should be delegated to the DataServer which in turn will make the actual method call on the Singleton Data object on the server side.
But I'm quite not sure about a good idea of how to achieve this...
Since the client and the server communicate through sockets, is it advisable to make a custom protocol which will make the client indicate the server which method to call on the Singleton Data class object?
If I were using RMI, I could have handled this by direct Remote method invovation (just by delegating the Data class methods on the client to the Data class methods on the Server which in turn will call the actual methods on the Data class object on the Server side).
But how can this be done using Sockets?...If at all it could be done by some message capturing mechanism using a custom protocol, the design will be very weak then...
I hope somebody can throw a light on it...
Awaiting an early response,
Thanks in advance,
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!