Specifies client-side network protocol options.
You should only use the CommLinks (LINKS) connection parameter only if you need to specify TCP/IP options. In most cases, you should use the HOST connection parameter. See Host connection parameter.
{ CommLinks | LINKS }={ [ SharedMemory | ShMem ] | ALL | [ TCPIP | TCP ] } [, ... ] string
Anywhere. The CommLinks (LINKS) connection parameter is optional for connections to a personal server, and required for connections to a network server.
CommLinks (LINKS) connection parameter values are case insensitive, and include:
SharedMemory (ShMem) Start the shared memory protocol for same-computer communication. This is the default setting. The client tries shared memory first if it is included in a list of protocols, regardless of the order in which protocols appear.
ALL Attempt to connect using the shared memory protocol first, followed by TCP/IP. Use this setting if you are unsure which communication protocol(s) to use.
TCPIP (TCP) Start the TCP/IP communication protocol. TCP/IP is supported on all operating systems. A personal database server is not started automatically if the CommLinks (LINKS) parameter includes TCPIP.
Each of these values can have additional network protocol options supplied. See Network protocol options.
Use only the shared memory communication protocol to connect.
If you do not specify a Host connection parameter or a CommLinks (LINKS) connection parameter, the client searches for a database server on the current computer only, and only using a shared memory connection. This is the default behavior, and is equivalent to CommLinks=ShMem. The shared memory protocol is the fastest communication link between a client and database server running on the same computer, as is typical for applications connecting to a personal database server.
For information about securing shared memory connections on Unix, see Security tips.
If you specify CommLinks=ALL, the client searches for a server using all available communication protocols. Since there may be an impact on performance if you specify CommLinks=ALL, use this setting only when you don't know which protocol to use.
If you specify both TCPIP and SharedMemory, shared memory is attempted first, followed by TCP/IP if the database server cannot be found over shared memory. Shared memory is attempted first, even if TCP/IP is specified first.
The CommLinks (LINKS) connection parameter corresponds to the -x database server option.
If you specify multiple settings for the same connection parameter, then the last value specified is the one that is used. For example, in the following connection string, both shared memory and TCP/IP are specified. In this case, TCP/IP is used because it was specified later in the string.
"UID=DBA;PWD=***;Server=demo;START=d:\sa12\bin64\dbsrv12.exe -x tcpip(port=3277);DBN=demo;DBF=d:\sa12\samples\demo.db;LINKS=SHMEM;ENC=none; CommLinks=tcpip(HOST=localhost)" |
The Host connection parameter is an alias to several existing TCP/IP options. In most cases you should not need to use the LINKS connection parameter. Because the host name is required, but the port number and ServerName connection parameter are optional, there are four possible combinations:
Example | Description | Equivalent LINKS connection parameter connection string |
---|---|---|
Host=serverhost:1234 | This string provides a unique way to find the database server. |
LINKS=tcpip(host=serverhost:1234;DoBroadcast=None;Verify=No) |
Host=serverhost:1234; ServerName=myserver |
This string provides a unique way to find the database server and a server name to verify. |
LINKS=tcpip(host=serverhost:1234;DoBroadcast=None;Verify=Yes); ServerName=myserver |
Host=serverhost | This connection string fragment does not provide a unique way to find the database server. Because a database server name is not specified, the client does not broadcast to find the database server. The client assumes a port number of 2638 so that it has a unique way to find the database server. | LINKS=tcpip(host=serverhost:2638;DoBroadcast=None;Verify=No) |
Host=serverhost; ServerName=myserver |
The host and the database server name are know, but the port number is not. The client sends a UDP packet to host serverhost, port 2638. If the client receives a response, then the response contains the database server's port number. The client makes a TCP connection to that host/port and verifies the database server name. |
LINKS=tcpip(host=serverhost;DoBroadcast=Direct;Verify=Yes); ServerName=myserver |
The following connection string fragment starts the TCP/IP protocol only:
CommLinks=tcpip |
The following connection string fragment starts the shared memory protocol and searches for the database server over shared memory. If the search fails, it then starts the TCP/IP protocol and searches for the server on the local network.
CommLinks=tcpip,shmem |
The following connection string fragment starts the shared memory protocol and searches for the server over shared memory. If the search fails, the TCP protocol is started and it searches for the server on the local network, and the host kangaroo. Note that if the server is found over shared memory, the TCP link is not started.
CommLinks=shmem,tcpip(HOST=kangaroo) |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |