Connection
for TCP/IP.
More...
#include <tcp_connection.h>
Inheritance diagram for mysqlpp::TCPConnection:
Public Member Functions | |
TCPConnection () | |
Create object without connecting it to the MySQL server. | |
TCPConnection (const char *addr, const char *db=0, const char *user=0, const char *password=0) | |
Create object and connect to database server over TCP/IP in one step. | |
TCPConnection (const TCPConnection &other) | |
Establish a new connection using the same parameters as an existing connection. | |
~TCPConnection () | |
Destroy object. | |
bool | connect (const char *addr=0, const char *db=0, const char *user=0, const char *password=0) |
Connect to database after object is created. | |
Static Public Member Functions | |
bool | parse_address (std::string &addr, unsigned int &port, std::string &error) |
Break the given TCP/IP address up into a separate address and port form. |
Connection
for TCP/IP.
This class just simplifies the connection creation interface of Connection
. It does not add new functionality.
|
Create object and connect to database server over TCP/IP in one step.
|
|
Establish a new connection using the same parameters as an existing connection.
|
|
Connect to database after object is created. It's better to use the connect-on-create constructor if you can. See its documentation for the meaning of these parameters. If you call this method on an object that is already connected to a database server, the previous connection is dropped and a new connection is established. |
|
Break the given TCP/IP address up into a separate address and port form. Does some sanity checking on the address. Only intended to try and prevent library misuse, not ensure that the address can actually be used to contact a server. It understands the following forms:
It also understands IPv6 addresses, but to avoid confusion between the colons they use and the colon separating the address part from the service/port part, they must be in RFC 2732 form. Example:
|