File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom protocol

 
Stephanie Grasson
Ranch Hand
Posts: 347
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mark and Carl for your suggestions!
Stephanie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic