Finally today I managed to transmit a message from my trial server back to a web browser running on my wife's computer. It was a simple message in HTML but enough to prove that I am getting the hang of the idea.
It looks like implementing a REST server that accepts HTTP messages and uses the paths and queries to create and format a response is fairly simple. I will need to write a client, but that is fairly simple in comparison and will need to be able accept a response in JSON or XML. A web browser based client also looks very possible now.
The next step is to transfer the statement of requirements into a design for the software.
At this stage I am thinking of going with JSON, there is a nice addon library to go with the one I am using for the GUI, and after reading up on it it seems ideal for lightweight data which is all I will be transporting.
It may be beyond the realms of this project, but security will no doubt be an issue that would need addressing, by using http which is a well known protocol, there would be a greater risk of hacking, especially if using the default port 80. However it seems that alternative urls can be used to get a web browser to use a different port such as http://www.amazon.co.uk:8045/, for a client application the port is not an issue as long as it uses the same as the server.
I feel a great deal happier about this project as a result of today's work. The issue was using sizeof(message.c_str()) which I wrongly assumed would give the length of the message in bytes. Instead I switched to sizeof(message.length()) which seems to work as expected.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment