[Gambas-user] Socket Limitations

Doriano Blengino doriano.blengino at ...1909...
Mon Jan 4 10:34:11 CET 2010


Kadaitcha Man ha scritto:
> 2010/1/4 Doriano Blengino <doriano.blengino at ...1909...>:
>
>   
>> My idea was to raise an event when a line has been read
>>     
>
> Based on what I just posted to the developer's list, you will need to
> be specific about what defines an end of line. For example:
>
> NUL     ^@     \0      Null character
> ETX     ^C              End of Text
> LF        ^J      \n      Line feed
> CR       ^M     \r      Carriage return
> ETB     ^W             End of Trans. Block
>
> Or, a combination of characters, such as \r\n.
>   
To accomplish this task (event when a whole line has been read), there 
would be a string property, containing the characters you want as EOL, 
or another sequence, or even the terminator "CRLF.CRLF". The program 
would set this property to what it pleases to.

Actually, it is a little too easy to suggest things without trying to 
develop them; I did it just a few messages ago, and I comprehend that 
before implementing a new feature Benoit has to take in account other 
factors, for example compatibility with previous versions, reliability, 
"strangeness" of some solution. This feature for reading lines or blocks 
is a little strange, I suppose. My problem is that I see some gambas 
limitations, but it would be wrong to try to turn gambas in something 
else which was not the original intention. For my extravagant ideas, 
there would exist a totally new language - a mix of Tcl, Python and 
Perl. So I think I must calm myself; take gambas for what it is, knowing 
that is not perfect for me, but good enough for a lot of people (me 
included).

I think that Benoit welcomes different points of view, but correctly he 
takes those advices with a grain (or a handful?) of salt.

With regards to our discussion, I see that our three points of view are 
not so different, and I enjoyed it. Gambas3 (which I never tried) is not 
yet stable, so it is forgivable for its glitches; I think that there is 
something extreme in trying to send large chunks of data in  a single 
instruction, but I must also stop to think in the terms of twenty years 
ago - computers, OSes and languages *must* be more powerful. So, 
blocking mode by default and a reasonable set of "normal" properties and 
events, like all the other languages and OSes do, could be a safe way. 
You say that an event for reading single lines from a socket would 
improve your programs: well, probably it is already possible to do so, 
using the current gambas features. Of course, if Benoit thinks that some 
internal gambas mechanism would help, I have nothing to regret.

I had to explain my mind; I suggest, advise and criticize mainly trying 
to be cooperative, but sometimes things go too much over.

Regards,
Doriano




More information about the User mailing list