[
https://issues.apache.org/jira/browse/THRIFT-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599223#comment-13599223
]
Evan Nemerson commented on THRIFT-1016:
---------------------------------------
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
(GBuffered{Input,Output}Stream, memory-only streams
(GMemory{Input,Output}Stream). And, if you subclass GIOStream and provide
custom G{Input,Output}Stream 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.
> using GSocket in c_glib library
> -------------------------------
>
> Key: THRIFT-1016
> URL: https://issues.apache.org/jira/browse/THRIFT-1016
> Project: Thrift
> Issue Type: Improvement
> Components: C glib - Library
> Reporter: david han
> Priority: Minor
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira