Hello,
I'm thinking about a server application, where multiple clients can connect to control a device and to show and visualize data. User identification (Password Login) is also needed and basic encryption.
Browser applications and the like could be a choice, but I prefere the native look and feel of a desktop application, so Lazarus it shall be.
My idea was to implement a custom protokoll based on TCP. Specifically I would define frames/packages, that start with a start character (e.g. ">"), followed by the frame length, followed by the frame data and finally terminated by a stop character (e.g. "<"). A frame would start with a command-ID and the following content would be command specific. Encryption could be done on frame level.
I also thought about using HTTP-requests instead, an advantage would be that each request has a response, so the client gets an answer in context. The problem that I see by that, is that the line is blocked until the response is delivered, which slows down things especially if small data packets are transfered in each request. As I understand browsers open several connections to circumvent this problem. If I try to implement that as well, it seems not very easy on client side: dynamically establish connections, route the responses to handlers etc.
On the other hand for the "single connection solution", responses would just be queued out and thus couldn't be associated to a request. For a simple OK, the client wouldn't know, which request was OK'ed by that, so additional information would have to be added on sender side and decoded/routed on receiver side. Which seems not very well scaling.
Has someone here done something like that before?
Some advice?
Thanks~