[Lazarus] Sockets

Marc Weustink marc.weustink at cuperus.nl
Wed Jul 15 11:03:43 CEST 2009


dayat wrote:
> Hi, I'm newbie in sockets programming.
> 
> I have code like:
> 
>   if not Accept(S, FromName, Sin, Sout) then
>     perror('Server accept: '+FromName);
> 
> The FromName variable is string. And when the Accept() function
> executed I got the error like:
> project1.lpr(31,28) Error: Call by var for arg no. 2 has to match
> exactly: Got "ShortString" expected "sockaddr_in"


Aahh... took me a while before I realized Accept has 5 different forms 
(defined in the unit sockets where the accept function is depricated)

Is Sockets the only unit you use or do you use more units ?

Do you use ansistrings ? (see {$H+} in the top of your code). Ifso, 
declare FromName as ShortString

Marc





More information about the Lazarus mailing list