Firebird Documentation IndexFirebird 1.5.6 Release Notes → Configuring the Port Service on Client and Server
Firebird Home Firebird Home Prev: POSIX PlatformsFirebird Documentation IndexUp: Firebird 1.5.6 Release NotesNext: Using the -p switch override

Configuring the Port Service on Client and Server

Table of Contents

How the server sets the listening port
Using the -p switch override
Classic on POSIX: the inetd or xinetd daemon
Using a configuration file parameter
Setting up a client to find the service port
Configuring the Services File

By default a Firebird server listens on port 3050 for connection requests from clients. Its registered port service name is gds_db. The good news is that, if you can go with these defaults, you have to do nothing on either server or clients to configure the port service.

You can use a different port, a different port service name, or both. You might need to do this if port 3050 is required for another service, for example, a concurrently running gds_db configured for a different version of Firebird or for an InterBase® server.

There are several ways to override the defaults. Both the server and the clients must be configured to override the port service name or number, or both, in at least one of these ways:

Before examining each of these techniques, it will helpful to look at the logic used by the server to set the listening port and by the client to set the port that it should poll for requests.

How the server sets the listening port

The server executable has an optional command-line switch (-p) by which it can signify either the port number it will be listening on or the name of the port service that will be listening. At this point, if the switch is present, either port number 3050 or the port service name (gds_db) is replaced by the argument supplied with the -p switch.

Next--or first, if there is no -p switch--a v.1.5 server checks firebird.conf to look at the parameters RemoteServiceName and RemoteServicePort:

  • If both are commented with "#" then the defaults are assumed and no further change occurs. Any -p argument stands and the "missing" argument remains as the default.

     

  • If RemoteServiceName has been uncommented, but not RemoteServicePort, then the port service name is substituted only if it has not been overridden already by the -p switch.

     

  • If RemoteServicePort has been uncommented, but not RemoteServiceName, then the port number is substituted only if it has not been overridden already by the -p switch.

     

  • If both RemoteServicePort and RemoteServiceName are uncommented, then the RemoteServiceName takes precedence if it has not already been overridden by a -p argument. If there is already a port service name override, the RemoteServiceName value is ignored and the RemoteServicePort value overrides 3050.

     

  • At this point, if an override of either the port number or the service name has been signaled, both v.1.0 and v.1.5 servers proceed to check the Services file for an entry with the correct combination of service name and port number. If a match is found, all is well. If not, and the port service name is not gds_db, the server will throw an exception and fail to start. If gds_db is the port service name and it cannot be resolved to any other port, it will map to port 3050 automatically.

If the default service name is to be overridden, then you will need to make an entry in the Services file--see the topic below, Configuring the Services File.

Prev: POSIX PlatformsFirebird Documentation IndexUp: Firebird 1.5.6 Release NotesNext: Using the -p switch override
Firebird Documentation IndexFirebird 1.5.6 Release Notes → Configuring the Port Service on Client and Server