aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes custom protocol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "custom protocol" Watch "custom protocol" New topic
Author

custom protocol

Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Hi all!
We are working on client/server code which allows remote users to control on-site hardware. The code uses sockets and the protocol is currently all strings. For example, the client may send "moveNegative,1,2000" to move axis-1 2000 steps in the negative direction. The server sends back a String describing the outcome of the request. The command strings are created at runtime based on user input.
Generally speaking, everything is working well, but I am concerned about memory issues and the String pool. Can anyone suggest a place which tells how to design effective custom protocols for client/server setups?
Thanks in advance.
Stephanie
Mark Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
Stephanie,

You can create a distributed object in java, c++ or some other language that has method for each of your commands. If you exposed this distributed object with CORBA then the protocol you'd be using would be IIOP.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Hey Stephanie,
If your client and server both know, when a new message starts; what the contents of the message are; what the contents mean and when the message ends, then you have created your own 'protocol'. I haven't run into a memory problem with the String pool in any application I've created including some that parsed 1GB of String data. Test your server with a single client, then multiple clients and observe how much memory it uses. I don't think you'll have much trouble with memory.

------------------
Hope This Helps
Carl Trusiak


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Thank you Mark and Carl for your suggestions!
Stephanie
 
Consider Paul's rocket mass heater.
 
subject: custom protocol