[Gambas-user] Server Socket Example

Demosthenes Koptsis demosthenesk at ...626...
Fri Jun 15 07:33:50 CEST 2012


Στις 12/6/2012 21:53, ο/η Benoît Minisini έγραψε:
> 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? :-)
>
The only reason i find is to have a Return way from Socket_Write().
It checks if the data were sent 10 times and then exit sub.

i changed this to check if data were sent 1 time and then exit sub.




More information about the User mailing list