[Gambas-devel] Socket Component

Benoit Minisini gambas at ...20...
Tue Jul 29 21:51:31 CEST 2003


Le Lundi 28 Juillet 2003 17:34, Nigel Gerrard a écrit :
> Benoit,
>
> I have been looking at a Socket component for Gambas for several weeks
> now..trying to fit it in between my day job which is still fairly hectic at
> the moment.
>
> Attached is a work in progress component ( with a basic server and client
> test program) which might be useful for some of the discussion that has
> been going on.  There are several problems with it at the
> moment...especially around the server side using a timer for polling. 
> There is also an issue with a warning message being displayed about
> 'allocations not being freed' - I believe it is probably due to NEW adding
> to the symbol list.
>
> Feedback will be useful on whether this can be used to move forward...I
> guess ultimately we are likely to want to use .NET (dotGNU and/or
> MONO...but I can't get my head around them at the moment.)
>
>
> Nigel

Here is what I thought about a network component. I imagined one component for 
connecting to a socket as a client, and one other component to let a 
application becoming a server.

As you quickly noticed, Nigel, there is a polling problem. You have a Gambas 
API function named "GB.Watch" that tells the interpreter that he must watch a 
file descriptor. Search "GB_Watch" (yes, with an underscore) in "CProcess.c".

This "client" component will almost be the same as your Socket component.

But the "server" component will be something more sophisticated. It will 
transform a Gambas application into a true TCP/IP server. The programmer will 
just have to specifiy a port number and a protocol. The component will do all 
the polling, all the accept stuff, and will manage each connection in the 
same process (no fork, no thread, the interpreter won't support them). The 
Gambas programmer will have nothing to do. As simple as possible !

I quickly looked your socket component, and there are problems, but it is just 
a lack of information about how to make components.

When the Gambas API documention will be finished, everything will be easier to 
program and understand of course !

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list