[Gambas-devel] gb.net updated

Daniel Campos dcamposf at ...176...
Thu Dec 15 10:50:07 CET 2005


OK, Now the Socket and UdpSocket classes use the native Id property:

http://gambas.gnulinex.org/net/gb.net.051214.tar.bz2

...and yes, I was using 0 as an invalid value, some times  I feel  I am
#$%&!!!!

Regards,

D. Campos



2005/12/13, Benoit Minisini <gambas at ...1...>:
>
> On Tuesday 13 December 2005 13:50, Daniel Campos wrote:
> > > But you already inherited it from the Stream class. You don't have to
> > > overwrite it; you have to return it from the "handle" function of the
> > > stream
> > > implementation.
> > >
> > > For example, in the Socket class implementation, you just have to
> return
> > > it
> > > from your CSocket_stream_handle() function instead of always returning
> > > zero.
> >
> > Do you think there will be no problems with your internal gbx code to
> > manage streams if I return a value different from Zero? I think I
> removed
> > that due to any problem with any of your interpreter functions that
> checks
> > the value of the stream handle...
> >
> > Regards,
> >
> > D. Campos
> >
>
> The interpreter uses the stream handle returned by this function in the
> following cases:
>
> 1) When closing a stream, if the stream handle is >= 0, then GB.Watch() is
> called to stop watching this file descriptor if it is watched. Then the
> stream close function is called.
>
> 2) When using LOCK or UNLOCK, the stream handle is used.
>
> 3) When calling Lof(), if the stream lof function returns a zero length,
> then
> the stream handle is used to call ioctl(..., FIONREAD, ...) to know how
> many
> bytes are readable on the handle.
>
> 4) To implement the Stream.Handle / Stream.Id property.
>
> That's all (I think so) :-)
>
> Note that you chose to return 0, that is a perfectly valid file handle. If
> you
> don't want to return any file handle, you have to return (-1), or to pass
> a
> NULL as stream handle function pointer.
>
> Regards,
>
> --
> Benoit Minisini
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20051215/93fd12ea/attachment.html>


More information about the Devel mailing list