• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

SKSocket connected with my socket server

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 3 Posters 777 Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    Morgan74
    last edited by 30 Jul 2010, 13:26

    Hello everybody,

    I wrote a small socket server to transport data between Sketchup and a PC over my LAN network.
    The SKSocket can connect and send data to my server without problems (FYI : String are send with UTF8 encoding)
    But (There is always a "but"...) when my server want to reply or send data to Sketchup : the SKSocket_listener isn't triggered 😞
    So I have captured the TCP stream with Wireshark (see image) and the TCP message is ACK by Sketchup 😢 😢 but never seen in Ruby.
    TCP stream

    Is there someone with a idea for this problem ?

    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 30 Jul 2010, 15:36

      The SKSocket class is undocumented and officially unsupported by Google.

      Can you post a minimal code snippet of what you have so far?

      Hi

      1 Reply Last reply Reply Quote 0
      • M Offline
        morisdov
        last edited by 1 Aug 2010, 20:55

        Hello Morgan,

        Although you can hack a solution that will work in your lab network, because of NAT and firewall rules this connectivity solution will be more trouble than its worth at customers sites.

        %(#0000BF)[In any case sketchups native UI.messagbox and UI.inputbox are not sufficient for a reasonable user interface so you must use sketchups Webdialog anyway.
        During the developent of the plugin you will need a "debug" interface from which you can manually send data either way and monitor results, so you must pass "complex" data structures to and from the webdialog !]

        If the assumptions above are indeed relevant to your case, use javascript ajax in sketchups webdialog to connect to the other data computer.

        Use Base64 encoding to pass complex data stuctures from Ruby to Javascript and on to the data computer and back. I also save Base64 encoded data structures in sketchups attribute dictionaries, to never worry about escaping illegal characters and binary data structures etc.
        I also use webdialog textboxes for monitoring sent and received data and manually injecting test data.

        Note the 2 KiloByte limit of each call from webdialog javascript to sketchup ruby - split longer data.

        1 Reply Last reply Reply Quote 0
        • M Offline
          Morgan74
          last edited by 15 Sept 2010, 16:17

          Hello,

          Thanks for your answer and your way to send datas through a Webdialog using ajax.

          For the SKSocket class, I have asked to Scott (a Googler) at the Basecamp and the response is this class as been developed for an internal test but it's not fully implemented and fully working so don't use it if you want to be sure your code will run correctly.

          Regarding my needs : Now I just want to handles events from another windows software directly inside Ruby so I'll open another topic in the forum.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement