pidgin plugins for corporate compliance
roy.develpidgin at xemaps.com
Thu Jun 14 19:07:50 EDT 2007
This might be more appropriate to a glib mailing list but since this
will eventually become a plugin...
I decided to give non-blocking IO a whirl using winsocks and am
reduced a to a weak puddle of ignorance and ineptitude. Basically in
a simple gtk app I've been trying to do this:
1. Get a SOCKET from a call to winsock's socket function and then call connect
2. Get a GIOChannel from g_io_channel_win32_new_socket
3. Call g_io_channel_set_flag with G_IO_FLAG_NONBLOCK
4. Call g_io_channel_set_encoding with NULL
5. Call g_io_channel_set_buffered with FALSE
6. Call g_io_add_watch for G_IO_IN and another one for G_IO_OUT
The very first time my G_IO_IN function tries to
g_io_channel_read_chars from my GIOChannel, I get a error on "Socket
operation on nonsocket". I've based my code on several different
examples (mostly unix ones) so I'm sure that I'm doing something
wrong. Could someone also tell me if the GIOChannel that I get back
from g_io_channel_win32_new_socket is for both reading and writing? If
not, how do I get separate channels?
I also noticed that libpurple has a bunch of functions in giowin32.c
that were made for reading and writing to a socket. Should I be using
those functions instead of the glib ones? Does anyone have a simple
sample that they could point me to?
much thanks in advance...
On 6/8/07, Roy Rim <roy.develpidgin at xemaps.com> wrote:
> Hi guys,
> OK so I managed to finagle a solution from the suggestions :)
> So I made the plugins hidden and load the plugins from within main in
> gtkmain.c. I use a third plugin for setting preferences.
> I've had to modify the perl.c to recognize a "flags" key in the plugin
> info hash so I could hide the perl plugin.
> Just one last question, when I send out emails it generally tends to
> freeze everything because (as I understand it) pidgin is not
> multi-threaded. I've been thinking about including blat or some other
> email software and maybe starting a separate process for emailing
> reports. Any suggestions on the best way to start a separate
> process/thread? I'm gonna go read up on GTK but any help is
> appreciated :)
> Thanks a lot guys!
> On 6/7/07, Mark Doliner <mark at kingant.net> wrote:
> > On Thu, 07 Jun 2007 11:04:57 -0500, Richard Laager wrote
> > > On Thu, 2007-06-07 at 10:40 -0500, Casey Harkins wrote:
> > > > Hiding the plugin would prevent it from being disabled. Another
> > > > possibility would be to not hide it, but create a second plugin that is
> > > > hidden that would keep the other one enabled.
> > >
> > > Or you could just unconditionally return FALSE from the
> > > plugin_unload() function or something.
> > I looked earlier... I don't think we look at the return value from
> > plugin_unload(). I think we should, though.
> > Another possibility is to have two plugins that watch each other's status, if
> > one of them is unloaded then the other one loads it again.
> > -Mark
> > _______________________________________________
> > Devel mailing list
> > Devel at pidgin.im
> > http://pidgin.im/cgi-bin/mailman/listinfo/devel
More information about the Devel