[Lazarus] Asyncronous socket error lNet

Michael Van Canneyt michael at freepascal.org
Mon Sep 29 11:32:44 CEST 2008


> 
> 
> On Mon, 29 Sep 2008, Aleš Katona wrote:
> 
> > 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:
> http://lnet.wordpress.com/usage/sockets-protocols-and-sending/
> 
> 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.

It works properly.

Michael.


More information about the Lazarus mailing list