My current project consists of a need to have bi-directional communication between a server and a handful of clients running sketchup. The idea is to be able to share model information in real-time between multiple sketchup sessions on multiple computers. The data will be simple but often. I'm looking for multi-player computer-game-like performance. The communication would be happening while the user is working in the sketchup file so it is critical to keep the performance hit to the model environment to a minimum.
I've been researching several different methods to accomplish this but don't which one is best:
Web Dialogs:
-
The first thought was to use webdialogs with some sort of AJAX/comet to long poll the server that stores info with php + mysql. However, this seems inefficient. I could be wrong.
-
bi-directional web got me thinking Websockets with HTML5. Alas, IE does not support it so that's a no-go. (wish sketchup could use chrome)
Extension library:
-
So then I bought a book on programming multiplayer games (copyright 2004 so it's old). The go through writing a network library in C++ that use sockets to communicate through UDP or TCP with a server. I was thinking that I could modify it to be a ruby extension library to use native within sketchup. Unfortunately, this is probably a lot harder then I think, if not impossible, as I do not know C++.
-
Then I looked for other pre-made network libraries. There are a few, however, I'm still unclear how I could get any of them to talk to sketchup.
All Ruby:
-
I see that there is an undocumented SKsocket class built into sketchup but I hear that's pretty unreliable.
-
Finally, full ruby has a socket.so that looked promising but I can't seem to load/require it in sketchup without getting a error "127: The specified procedure could not be found."
I'm frustrated that no one solution has jumped out. Any guidance to how you would approach the problem would be much appreciated.
Thanks,
Mike Talbott