Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
36
Добавлен:
18.03.2015
Размер:
608.7 Кб
Скачать

Configuring the Port Service on Client and Server

Caution

Connection requests will fail if both xinetd (or inetd) and fbserver (or ibserver) attempt to listen on the same port. If your host machine has this double configuration, it will be necessary to set things up so that each server version has its own service port.

Using a configuration file parameter

You can configure either RemoteServiceName or RemoteServicePort in firebird.conf to override either the default port number (3050) or the default port service name (gds_db) that the server uses to listen for connection requests.

The engine will use one RemoteService* parameter, but not both. If you configure both, it will ignore RemoteServicePort in all cases, except where the server start command was invoked with the -p switch supplying an override to the port service name. Thus, you can use the -p switch and a RemoteService* parameter, in combination, to override both port number and service name.

If the default service name is to be overridden, then you need to make an entry in the Services file.

Tip

GOTCHA! If you uncomment RemoteServiceName or RemoteServicePort, but leave the default values intact, they will be treated as overrides. It will then be necessary to make an explicit entry in the services file for the default port service settings.

Setting up a client to find the service port

If you set up your server with the installation defaults (service gds_db listening on port 3050) then no configuration is required. If the server is listening on a different port or is using a different port service name, the client application and/or its host machine need some enabling configuration to help the Firebird client library to find the listening port.

The connection string used by a client can include information for polling the server's listening port in various ways. Firebird 1.5 clients can optionally use a local copy of firebird.conf. Changes may also be needed in the client's services file.

Using the connection string

If only the port number or the service name has been reconfigured, then include the alternative port number or service name in the connection string. This works for all versions of Firebird.

Syntax for TCP/IP connections

To connect to a database named server named alice that is broadcasting on port 3050 with the service name fb_db, the connection string would be:

For POSIX:

90

Configuring the Port Service on Client and Server

alice/fb_db:/data/teaparty.fdb

Or, if the service name is gds_db and the port number is 3051:

alice/3051:/data/teaparty.fdb

For Windows:

alice/fb_db:D:\data\teaparty.fdb

Or, if the service name is gds_db and the port number is 3051:

alice/3051:D:\data\teaparty.fdb

Note

Notice that the separator between the server name and the port is a slash, not a colon. The colon before the physical path string is still required.

Syntax for WNet connections

On a WNet network, use UNC-style notation:

\\alice@3051\d:\teaparty.fdb

or

\\alice@fb_db\d:\teaparty.fdb

If the server's configured port number or service name is an override, then you need to make an entry in the Services file.

Using port syntax with database aliases

To connect through a non-default port with a database alias, affix the port number or service name to the server name, not to the alias. For example, suppose the database alias is stored in aliases.conf as

rabbit = /data/teaparty.fdb

Your application's connection string for server 'alice' would be:

alice/fb_db:rabbit

or

91

Соседние файлы в папке doc