Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-10

Indy 10 HTTP Server component with FPC

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Is anybody here using the Indy 10 components with FPC? More specifically, the HTTP Server component. My project compiles fine, but when I activate the HTTP Server I get the following error.

"Socket error # 98. Address already in use."

I know that under Linux, if you use a port < 1024 you must have root access, so I even tried with port 8080, but no matter what port I use, or even if I execute my app with root privileges, I always get the same error.

I downloaded a daily snapshot archive of Indy 10 from their repository a few days ago. I have no idea what revision or version number it is.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

Show quoted text 13 lines
Is anybody here using the Indy 10 components with FPC? More specifically, the HTTP Server component. My project compiles fine, but when I activate the HTTP Server I get the following error. "Socket error # 98. Address already in use." I know that under Linux, if you use a port < 1024 you must have root access, so I even tried with port 8080, but no matter what port I use, or even if I execute my app with root privileges, I always get the same error. I downloaded a daily snapshot archive of Indy 10 from their repository a few days ago. I have no idea what revision or version number it is.

I haven't tried for years, but I can remember some strange problems designtime that went away if you manually added a tidbinding in formcreate.

Reply by email

Graeme Geldenhuys
to Marco van de Voort
Marco van de Voort wrote
I haven't tried for years, but I can remember some strange problems designtime that went away if you manually added a tidbinding in formcreate.

I'm not using design-time usage at all, everything is done manually via code. I'm creating a TIdHTTPServer instance via code, set the port, one basic event handler, and then when I try to set Active = True, that's when the error pops up.

I'll try and debug it some more - hopefully it is something small. If not, I'll have to do some Adapter Pattern magic in tiOPF to get n-tier support going. I used Indy components years ago in Delphi 7, and remember they were quite good. It would be a pity if FPC developers couldn't benefit from them too.

I believe you helped them with FPC support some years back moving from Kylix's libc unit to FPC's baseunix. I think I read this somewhere.

Anyway, back to debugging Indy some more then.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

Show quoted text 6 lines
> designtime that went away if you manually added a tidbinding in formcreate. I'm not using design-time usage at all, everything is done manually via code. I'm creating a TIdHTTPServer instance via code, set the port, one basic event handler, and then when I try to set Active = True, that's when the error pops up.

You need to add a tidbinding record to bindings. IIRC that is used to find the interface to bind on.

Reply by email

Burkhard Carstens
to Graeme Geldenhuys: I'm not using design-time usage at all, everything is done manually via code. I'm…
Graeme Geldenhuys wrote 9 lines
On 22/10/2011, Marco van de Voort wrote: > I haven't tried for years, but I can remember some strange problems > designtime that went away if you manually added a tidbinding in > formcreate. I'm not using design-time usage at all, everything is done manually via code. I'm creating a TIdHTTPServer instance via code, set the port, one basic event handler, and then when I try to set Active = True, that's when the error pops up.
For TIdTCPServer I manually add the IPv4 binding like this:
IdTCPServer1.Bindings.add.IPVersion:=Id_IPv4;
IdTCPServer1.Active:=true;

Without that, Activate fails on linux systems that have ipv6 enabled.

regards
Burkhard

Reply by email

Graeme Geldenhuys
to Burkhard Carstens
Burkhard Carstens wrote 6 lines
For TIdTCPServer I manually add the IPv4 binding like this: IdTCPServer1.Bindings.add.IPVersion:=Id_IPv4; IdTCPServer1.Active:=true; Without that, Activate fails on linux systems that have ipv6 enabled.

Thanks Bulkhard! Finally I am making progress with FPC & Indy 10. :)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email