Specifies the port the database server is running on.
{ ServerPort | PORT }=port-number
TCP/IP, HTTP, HTTPS
port-number For a 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. When you specify a list and/or range of port numbers, the database server attempts to bind to all specified port numbers. For example:
For a client, the ServerPort (PORT) 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 database server.
TCP/IP 2638
HTTP 80
HTTPS 443
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.
When you specify the ServerPort (PORT) protocol option, only the specified port number is used for TCP/IP connections and UDP broadcasts. If you do not specify the ServerPort protocol option, port 2638 is used. Applications can connect to the database server without specifying a port number. Having port 2638 available allows SQL Anywhere clients to find SQL Anywhere database servers running on other subnets and through firewalls.
Then the server listens to the same UDP port as the TCP/IP port. 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 you using a web server, by default, the database server listens on the standard HTTP and HTTPS ports of 80 and 443, respectively.
UDP packets sent by the database server in response to client broadcasts contain no sensitive information. The data contained in these packets is limited to:
You can hide database names from broadcast requests by using the -dh option. You can also specify -sb 0 to disable the UDP listeners completely.
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 database server is not using the default port (2638).
For example if the database server is started with the command dbsrv12 -n MyServer samples-dir/demo.db
, a client on the same subnet can find the server using the following connection parameters Server=MyServer;LINKS=tcpip
. If another server is started on Mac OS X, with the following command dbsrv12 -n SecondServer -x tcpip(PORT=7777) samples-dir/demo.db
, a client on the same subnet can find the server using the connection parameters Server=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.
The following example shows how to use the PORT protocol option to specify the port the database server starts on.
Start a network database server:
dbsrv12 -x tcpip -n server1 |
Port number 2638 is now taken.
Attempt to start another database server:
dbsrv12 -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.
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:
dbsrv12 -xs http(port=8080) -n server3 web.db |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |