[Gambas-user] Newbie question: socket example

Olivier Coquet ocoquet at 3d-phenomen.fr
Mon Feb 1 08:19:41 CET 2021


Hello petter,

what do you mean by socket component?

are you talking about 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

friendship
Olivier Coquet


Le 31/01/2021 à 19:52, pf a écrit :
>
> newbie Question
>
> I try o use the Socket component. Enabled the component in a new 
> project and put in the example code from the help.
>
> It got stuck on the ClsMain, "Unknown identifier"
>
> Regards Chris
>
> Paste from the help i use:
>
> ' Gambas class file STATIC App AS ClsMain PUBLIC MySock AS Socket 
> PUBLIC SUB MySock_Ready() WRITE #MySock,"Hello",5 END PUBLIC SUB 
> MySock_Read() DIM sCad AS String READ #MySock,sCad,Lof(MySock) PRINT 
> sCad CLOSE #MySock END PUBLIC SUB _New() MySock=NEW Socket AS "MySock" 
> MySock.Connect("name_of_host",3450) END PUBLIC SUB MySock_Error() 
> PRINT "Unable to connect" END STATIC PUBLIC SUB Main() App=NEW ClsMain END
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210201/d12c2f98/attachment.htm>


More information about the User mailing list