[Gambas-user] Re: Problem with connection on socket

Daniel Campos daniel.campos at ...338...
Tue Jan 11 23:46:14 CET 2005


Bodard Fabien escribió:

>This is my test program ...
>
>Thank for your help 
>Fabien
>  
>
The problem is that you're trying to read 60 bytes from Socket, but you
really don't know how many data is waiting in the socket. The correct thing
is to read just the data that is available in the socket, using, for example
the Lof() function:

PUBLIC SUB MySocket_Read()
 
DIM a AS String
  READ #MySocket, a, Lof(MySocket)
  PRINT a
  MyDns.Stop
 
 
END

That solves the problem.






More information about the User mailing list