// JP opened flex table

Click to See Complete Forum and Search --> : non blocking socket


rkillera
March 14th, 2002, 03:37 AM
This is my client socket read function (Borland C++ Builder) and i dont recieve all the lines from the server. Any ideea why? Maybe I should use a blocking socket instead and if so can u give me an example of how to use it?

void __fastcall TData::ClientSocketRead(TObject *Sender,
TCustomWinSocket *Socket)
{
AnsiString tmp;
tmp=ClientSocket->Socket->ReceiveText();
TopForm->Memo1->Lines->Add(tmp);
}

Ali Raza
March 20th, 2002, 06:47 AM
Hi!
The problem is that when you call a function for receiving data, it just reads the available data from the port and returns. If there comes some more data on that port then you've to call the receive data again.
While using non-blocking sockets you should receive the data in a loop untill all the data is received or server sends some end of data mark.

hope it will work....
Ali.

//JP added flex table