I’m not sure I fully understand the scenario, but you might try using the ofxJSON of similar add-on that can be used in conjunction with an HTTP request, and write something like the following. With this protocol, it shouldn’t matter if it takes up 2 seconds max for the server to return the request…
Thanks for the tip !
I don’t think i understand the exact purpose of all this but i will make some research. And i don’t understand why with this protocol i shouldn’t matter anymore…
are you used to ethernet connexions with openframeworks ?
The code I gave you depends on writing a server-side application to manage communication between an Openframenworks app and a remote or onsite server, so yes, through ethernet you might say. But with that you would need to follow an HTTP request protocol ( http://en.wikipedia.org/wiki/Hypertext-Transfer-Protocol ). That protocol shouldn’t present issues if it takes two seconds for your server side app to return the results–you can just parse the data appropriated whenever it is returned. The code that you have sent it looks like you are doing something similar–connecting to a server, setting up a way to receive data, and then generating a specific request to get what you need. I don’t know what the server-side application you’ve written looks like, nor is that app’s structure in the scope of this forum, but I’m merely suggesting an alternative if the 2 second delay is a problem. Maybe my solution is quicker for you? I don’t know. You can try it or not. That’s about extent to the help that I can provide here. Good luck!
Ok, thanks for the suggestion.
But i don’t think this help for my purpose as i am on the client side and try to connect to embedded TCP server.
The server is a video projector to which i would like to send commands such as Power on/off.