Re: Communication between server/client (sockets)!
From: Chuck Dillon (cdillon_at_nimblegen.com)
Date: Mon, 18 Aug 2003 09:55:23 -0500
> Im currently writing a server application based on socket fd's.
> The server gets information from other computers to perform
> certain tasks.
> The design will be a "Concurrent, connection oriented" server.
> anyway, what is the best way to communicate? I've seen the http
> protocoll using ASCII strings, right?
If you don't have performance issues to prevent the use of a text based
protocol it's useful to stick with text at least for the control data.
It helps with debugging and troubleshooting to be able to use telnet
to connect to your server and talk to it.
You should consider basing your protocol on XML. Using XML allows you
to leverage existing parsers rather than role your own and it gives you
the ability to scale up. IOW to easily expand your protocol, to handle
multiple versions and that kind of thing.
> Similar to: "GET index.html" and the servers returns index.html.
> My server needs input like: "DO JOB BATCH FILE1 FILE 2", whats
> the best way to communicate, whats mainly used? Is this a good
> way, implement a parser server side and parse every request?
> And, is it better to submit a script python or similar which holds
> all information?
> All input is welcome, my sockets are open :-)
> // Majk
-- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.