Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Connection Parameters and Network Protocol Options » Network protocol options

SendBufferSize protocol option [SNDBUFSZ] Next Page

ServerPort protocol option [PORT]


Specifies the port the database server is running on.

Usage

TCP/IP, HTTP, HTTPS

Values

Integer

Default

The default value for TCP/IP is 2638. The default value for HTTP is 80. The default value for HTTPS is 443.

Remarks

The Internet Assigned Numbers Authority has assigned the SQL Anywhere database server port number 2638 to use for TCP/IP communications. However, other applications are not disallowed from using this reserved port, and this may result in an addressing collision between the database server and another application.

In the case of the database server, the ServerPort protocol option designates the port number on which to communicate using TCP/IP. You can specify a single port number, or a combination of individual port numbers and ranges of port numbers. For example:

When you specify a list and/or range of port numbers, the application keeps trying port numbers until it finds one to which it can successfully bind.

The database server always listens on UDP port 2638 on most operating systems, even if you specify a different port using a network protocol option. Hence, applications can connect to the database server without specifying a port number.

For a client, the ServerPort protocol option informs the client of the port or ports on which database servers are listening for TCP/IP communication. The client broadcasts to every port that is specified by the ServerPort (PORT) protocol option to find the server.

If you using a web server, by default, the database server listens on the standard HTTP and HTTPS ports of 80 and 443, respectively.

If you start a database server using TCP/IP port number 2638 (the default), then the server also listens to UDP port 2638. The database server listens to UDP ports and responds to requests on these ports so that clients can locate the database server by server name.

If the database server's TCP/IP port number is not 2638, then the server listens to the same UDP port as the TCP/IP port.

Differences on Mac OS X

Mac OS X does not allow multiple processes to bind to the same UDP port. When the database server is running on one of these platforms, it only listens to the specified UDP port or port 2638 if no port is specified.

This means that clients must specify the TCP/IP port number if the server is not using the default port (2638).

For example if the database server is started with the command dbsrv10 -n MyServer samples-dir/demo.db, a client on the same subnet can find the server using the following connection parameters ENG=MyServer;LINKS=tcpip. If another server is started on Mac OS X, with the following command dbsrv10 -n SecondServer -x tcpip(PORT=7777) samples-dir/demo.db, a client on the same subnet can find the server using the connection parameters ENG=SecondServer;LINKS=tcpip(PORT=7777). Note that if the database server was running on a platform other than Mac OS X, then the client would not need to specify the PORT parameter.

Additionally, on Mac OS X, if a SQL Anywhere database server is already using port 2638, and a second network database server was started without the PORT protocol option, the second network server would fail to start. The reason for this is users need to know and specify the server's port number in their connection parameters. Personal servers start successfully, even if port 2638 is in use, because shared memory is normally used to connect to personal servers.

Example

The following example shows how to use the PORT protocol option to specify the port the server starts on.

  1. Start a network database server:

    dbsrv10 -x tcpip -n server1

    Port number 2638 is now taken.

  2. Attempt to start another database server:

    dbsrv10 -x tcpip -n server2

    The default port is currently allocated, and so the server starts on another port. On Mac OS X, this will fail.

  3. If another web server on your computer is already using port 80 or you do not have permission to start a server on this low of a port number, you may want to start a server that listens on an alternate port, such as 8080:

    dbsrv10 -xs http(port=8080) -n server3 web.db