[Lazarus] Asyncronous socket error lNet

Aleš Katona almindor at gmail.com
Mon Sep 29 11:25:17 CEST 2008

Dňa Ne, 2008-09-28 o 20:14 +0200, Usuario Anónimo napísal:
> I get an asyncronous socket error.
> This is my code.
> procedure TForm1.Button1Click(Sender: TObject);
> var
>   Item: string;
> begin
>   System.Assign(DataModule1.ItemFile,'items.txt');
>   System.Reset(DataModule1.ItemFile);
>   repeat
>     System.Read(DataModule1.ItemFile,Item);
> DataModule1.LTCPComponent1.SendMessage(Item,DataModule1.LTCPComponent1.Iterator);
>   until EOF(DataModule1.ItemFile);
>   System.Close(DataModule1.ItemFile);
> end; 
> Why?

You need to check if .Send or .SendMessage in your case don't return 0.
If so either an error on the network occurred (reported by OnError
event), or the OS send buffer is full and you need to use the OnCanSend
event. For more info on sending big data see:

Btw. is DataModule now working properly in Lazarus? Last I tried it's
things weren't visible in the OI on other units of the project.

> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

More information about the Lazarus mailing list