[Gambas-user] Server Socket Example

Benoît Minisini gambas at ...1...
Tue Jun 12 20:53:27 CEST 2012


Le 10/06/2012 22:00, Demosthenes Koptsis a écrit :
> Hi list,
>
> i work on a server project similar to ServerSocket example and i have
> some questions
>
> 1) in example i see that there is the use of Tag property for the socket as
>
> Public Sub MyServerSocket_Connection(sHost As String)
> ....
> Obj.Tag = [$iId, 0, ""]
> ....
> End Sub
>
> i understand that
> Tag[0] is the socket id
> Tag[2] is the socket data
>
> what is Tag[1];

It is just a hack, to associate a counter with the socket.

>
> 2) it is used in sub Public Sub Socket_Write()  to send 10 times data to
> client,
> why to send 10 times data? I dont understand it.

No reason. The example was used for testing the gb.net component. Maybe 
some cleanup is needed? :-)

-- 
Benoît Minisini




More information about the User mailing list