[Gambas-user] Newbie question: socket example

Olivier Coquet ocoquet at 3d-phenomen.fr
Mon Feb 1 09:02:50 CET 2021


hi Bruce,
Sorry, I saw my error just a little too late...the message was already 
sent :(
As long as I didn't drink my coffee in the morning, I don't have very 
clear ideas :)

Friendship
Olivier

Le 01/02/2021 à 08:48, Bruce Steers a écrit :
>
>
> On Mon, 1 Feb 2021 at 07:21, Olivier Coquet <ocoquet at 3d-phenomen.fr 
> <mailto:ocoquet at 3d-phenomen.fr>> wrote:
>
>     Hello petter,
>
>     what do you mean by socket component?
>
>     are you talking about gb.net <http://gb.net> ?
>
>     Also, I don't understand this line:
>
>      MySock=NEW Socket AS "MySock"
>
>     which should be:
>
>      MySock=NEW Socket
>
>     Because, in the class header there is :
>
>     PUBLIC MySock AS Socket
>
>
> No Oliver the code is correct. your statement "which should be" is 
> wrong though,  you appear to be ill-advising.
>
> To access the socket events like _Read the socket is named at creation 
> with 'As "MySocket"'
> then a function like...
> Public Sub MySocket_Read() becomes available.
> Or..
> PUBLIC MySock As Socket  ' defines a socket object but does not create one
> MySock = New Socket As "MyNewSocket"  '  creates the socket with a 
> reference name of MyNewSocket
> with the above code MySocket_Read() event will not happen but 
> MyNewSocket_Read() will.
> Do you understand?
>
> BruceS
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210201/4e036fac/attachment.htm>


More information about the User mailing list