Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: C glib - Library
    • Labels:
      None

      Description

      I looking the source of the c_glib library implement, It using the posix socket to implement the ThriftSocket.
      but there already realize the it as GSocket in GIO (a part in GLib) module, and the GSocket is crossing OS platform.
      so we can use it as the basic socket in ThriftSocket.

        Activity

        david han created issue -
        Show
        david han added a comment - GLib documen t: http://www.gtk.org/documentation.html GIO document : http://library.gnome.org/devel/gio/stable/ GSocket document : http://library.gnome.org/devel/gio/stable/GSocket.html
        Bryan Duxbury made changes -
        Field Original Value New Value
        Priority Critical [ 2 ] Minor [ 4 ]
        Hide
        Evan Nemerson added a comment - - edited

        I don't think GSocket is the right way to go. It is pretty low level (really just cross-platform version of BSD sockets), and I think it would make much more sense to use GIOStream instead. By doing so, thrift_c_glib could be used with files, sockets, TLS connections, etc. By subclassing GIOStream, you can also get easy access to compression (GZlibCompressor), buffered I/O (GBufferedInputStream/GBufferedOutputStream), memory-only streams (GMemoryInputStream/GMemoryOutputStream). And, if you subclass GIOStream and provide custom GInputStream/GOutputStream implementations, you can support pretty much anything the consumer wants to (LZMA, SASL, etc.). AFAICT GIO could actually replace most, if not all, of the ThriftTransport* stuff.

        Just about the only shortcoming I see is that you're still restricting yourself to streams, so layering it on top of something like AMQP will be sub-optimal. It would be nice to work out an API for that at some point, but it's probably more of a long-term goal.

        A related issue would be using GSocketService to replace most of the server code. You even get multi-threading for free with GThreadedSocketService.

        Show
        Evan Nemerson added a comment - - edited I don't think GSocket is the right way to go. It is pretty low level (really just cross-platform version of BSD sockets), and I think it would make much more sense to use GIOStream instead. By doing so, thrift_c_glib could be used with files, sockets, TLS connections, etc. By subclassing GIOStream, you can also get easy access to compression (GZlibCompressor), buffered I/O (GBufferedInputStream/GBufferedOutputStream), memory-only streams (GMemoryInputStream/GMemoryOutputStream). And, if you subclass GIOStream and provide custom GInputStream/GOutputStream implementations, you can support pretty much anything the consumer wants to (LZMA, SASL, etc.). AFAICT GIO could actually replace most, if not all, of the ThriftTransport* stuff. Just about the only shortcoming I see is that you're still restricting yourself to streams, so layering it on top of something like AMQP will be sub-optimal. It would be nice to work out an API for that at some point, but it's probably more of a long-term goal. A related issue would be using GSocketService to replace most of the server code. You even get multi-threading for free with GThreadedSocketService.

          People

          • Assignee:
            Unassigned
            Reporter:
            david han
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development