I am trying to listen a UDP broadcast packet from port 67.

I am trying to listen a UDP broadcast packet from port 67.

In windows works fine, I used TidUDPServer, binding IP and PORT and I see the traffic.

but

I ported the console project to Tokyo 10.2 ... for Linux, but I cannot start the server.

I receive the error: "cannot bind to socket, address and port already in use"

I tried also TIdUDPServer.ReuseSocket properties ... but nothing

I tried aldo in Firemonkey OSX ... same error.

naturally, If I change the port .. works fine!

I read in internet that port 67 on linux ... is private

anyone has suggestions ?

Comments

  1. SOLVED ... thanks Ondrej Kelle ... I must use root privilege to run the process ... thanks for all!

    ReplyDelete
  2. yes, root is needed for all ports < 1024 under Linux: just switch to a higher value, and you won't need root privilege

    ReplyDelete
  3. on production, if you need such low-level port number and have better your service not run under the root priviledge, use a forward proxy (e.g. nginx or haproxy). it is very efficient and has almost no performance penalty under Linux (the loopback IP address is very fast under Linux: magnitudes faster than under Windows, last time I checked). but of course, such proxy won't work for a UDP broadcast system. ;)

    ReplyDelete

Post a Comment