|
The Assimilation Monitoring Project
|
This is our basic NetGSource object. More...
|
Data Structures | |
| struct | _NetGSource |
| The NetGSource class objects integrate NetIO class objects into the g_main_loop paradigm. More... | |
Functions | |
| FSTATIC gboolean | _netgsource_prepare (GSource *source,gint *timeout) |
| GSource prepare routine for NetGSource - always returns TRUE Called before going into the select/poll call - to get things ready for the poll call. More... | |
| FSTATIC gboolean | _netgsource_check (GSource *gself) |
| GSource check routine for NetGSource. More... | |
| FSTATIC gboolean | _netgsource_dispatch (GSource *gself,GSourceFunc ignore_callback,gpointer ignore_userdata) |
| GSource dispatch routine for NetGSource. More... | |
| FSTATIC void | _netgsource_finalize (GSource *gself) |
| Finalize (free) the NetGSource object. More... | |
| FSTATIC void | _netgsource_addListener (NetGSource *, guint16, Listener *) |
| FSTATIC void | _netgsource_del_listener (gpointer) |
| FSTATIC void | _netgsource_sendaframeset (NetGSource *self,const NetAddr *addr,FrameSet *fs) |
| Send a single frameset to the given address. More... | |
| FSTATIC void | _netgsource_sendframesets (NetGSource *self,const NetAddr *addr,GSList *fslist) |
| Send a (GSList) list of FrameSets to the given address. More... | |
| NetGSource * | netgsource_new (NetIO *iosrc, GDestroyNotify notify, gint priority, gboolean can_recurse, GMainContext *context, gsize objsize, gpointer userdata) |
| Create a new (abstract) NetGSource object. More... | |
This is our basic NetGSource object.
It is used for reading from NetIO class objects in the context of the g_main_loop GSource paradigm. It is a class from which we might eventually make subclasses, and is managed by our C-Class Management system.
| FSTATIC void _netgsource_addListener | ( | NetGSource * | self, |
| guint16 | fstype, | ||
| Listener * | disp | ||
| ) |
| [in,out] | self | Object being modified |
| [in] | fstype | FrameSet fstype |
| [in] | disp | dispatch function |
Definition at line 244 of file netgsource.c.
References REF.
Referenced by netgsource_new().

| FSTATIC gboolean _netgsource_check | ( | GSource * | gself | ) |
GSource check routine for NetGSource.
Called after the select/poll call completes.
| [in] | gself | NetGSource object being 'check'ed. |
Definition at line 151 of file netgsource.c.
References CASTTOCLASS.
Referenced by _netgsource_prepare().

| FSTATIC void _netgsource_del_listener | ( | gpointer | lptr | ) |
Definition at line 63 of file netgsource.c.
References CASTTOCLASS, and UNREF.
Referenced by netgsource_new().

| FSTATIC gboolean _netgsource_dispatch | ( | GSource * | gself, |
| GSourceFunc | ignore_callback, | ||
| gpointer | ignore_userdata | ||
| ) |
GSource dispatch routine for NetGSource.
Called after our check function returns TRUE. If a bunch of events are fired at once, then this call will be dispatched before the next prepare call, but perhaps not quite right away - depending on what other events (with possibly higher priority) get dispatched ahead of us, and how long they take to complete.
| [in,out] | gself | NetGSource object being dispatched |
| ignore_callback | [ignore] callback not being used | |
| ignore_userdata | [ignore] userdata not being used |
Definition at line 164 of file netgsource.c.
References __FUNCTION__, CASTTOCLASS, DEBUGMSG, cma.cma::disp, _FrameSet::fstype, _Listener::got_frameset, and UNREF.
| FSTATIC void _netgsource_finalize | ( | GSource * | gself | ) |
Finalize (free) the NetGSource object.
If this next call crashes, you should have supplied your own finalize routine (and maybe you should anyway)
| [in,out] | gself | object being finalized |
Definition at line 197 of file netgsource.c.
References __FUNCTION__, CASTTOCLASS, DEBUGMSG, FREECLASSOBJ, and proj_class_dissociate().

| FSTATIC gboolean _netgsource_prepare | ( | GSource * | source, |
| gint * | timeout | ||
| ) |
GSource prepare routine for NetGSource - always returns TRUE Called before going into the select/poll call - to get things ready for the poll call.
| source | [unused] - GSource object |
| timeout | [unused] - timeout |
Definition at line 140 of file netgsource.c.
References _netgsource_check().

| FSTATIC void _netgsource_sendaframeset | ( | NetGSource * | self, |
| const NetAddr * | addr, | ||
| FrameSet * | fs | ||
| ) |
Send a single frameset to the given address.
| self | NetGSource class Object to send via |
| addr | NetAddr class address to send to |
| fs | FrameSet class to send |
Definition at line 227 of file netgsource.c.
References _NetIO::sendaframeset().
Referenced by netgsource_new().


| FSTATIC void _netgsource_sendframesets | ( | NetGSource * | self, |
| const NetAddr * | addr, | ||
| GSList * | fslist | ||
| ) |
Send a (GSList) list of FrameSets to the given address.
| self | NetGSource class object to send via |
| addr | NetAddr class address to send to |
| fslist | GSList of FrameSet class objects to send |
Definition at line 236 of file netgsource.c.
References _NetIO::sendframesets().
Referenced by netgsource_new().


| NetGSource* netgsource_new | ( | NetIO * | iosrc, |
| GDestroyNotify | notify, | ||
| gint | priority, | ||
| gboolean | can_recurse, | ||
| GMainContext * | context, | ||
| gsize | objsize, | ||
| gpointer | userdata | ||
| ) |
Create a new (abstract) NetGSource object.
| [in,out] | iosrc | Network I/O object |
| [in] | notify | Called when object destroyed |
| [in] | priority | g_main_loop dispatch priority |
| [in] | can_recurse | TRUE if it can recurse |
| [in] | context | GMainContext or NULL |
| [in] | objsize | number of bytes in NetGSource object - or zero |
| [in,out] | userdata | Userdata to pass to dispatch function |
Definition at line 74 of file netgsource.c.
References _NetGSource::_dispatchers, _NetGSource::_finalize, _NetGSource::_gfd, _NetGSource::_gsfuncs, _NetGSource::_gsourceid, _netgsource_addListener(), _netgsource_del_listener(), _netgsource_sendaframeset(), _netgsource_sendframesets(), _NetGSource::_netio, _NetGSource::_socket, _NetGSource::_userdata, _NetGSource::addListener, BINDDEBUG, CASTTOCLASS, FREECLASSOBJ, _NetIO::getfd(), MALLOCBASECLASS, proj_class_register_object(), proj_class_register_subclassed(), _NetGSource::sendaframeset, _NetGSource::sendframesets, and _NetIO::setblockio().
Referenced by main().

