When an application creates a direct Transmission
Control Protocol (TCP) connection, the BlackBerry device uses the
Access Point Name (APN) information.
Note: For instructions on specifying the APN settings on the BlackBerry
device, see KB05327.
For instructions on creating a socket or HTTP connection, see DB-00396.
However, it is possible for an application to specify the
APN information used for a direct TCP connection. This information
overrides anything configured in the TCP options of a BlackBerry
device. The following line of code is an example of a direct TCP
socket connection that provides direct TCP APN parameters:
Connector.open
("socket://yourServer:5445;deviceside=true;apn=internet.com;
tunnelauthusername=user165;tunnelauthpassword=user165password")
The apn parameter contains the APN over which
the connection will be made.
The tunnelauthusername parameter contains the
user name to connect to the APN.
The tunnelauthpassword parameter contains the
password for the tunnelauthusername.
The tunnelauthusername and tunnelauthpassword parameters
can be omitted from the connection URL if they are not required
by the APN.
Note: The deviceside=true parameter is present in the
example above to make sure that the connection is made using direct
TCP. These parameters are only useful when creating a direct TCP
connection and are not required when making a connection through
the BlackBerry Mobile Data System. Connections through the BlackBerry
Mobile Data System are automatically routed by the BlackBerry device;
therefore, no APN information is required.