SDK Connection pool API documentation

Version: alpha

FUNCTION
dmConnectionPool::Close()
dmConnectionPool::Delete()
dmConnectionPool::Dial()
dmConnectionPool::GetSSLSocket()
dmConnectionPool::GetSocket()
dmConnectionPool::New()
dmConnectionPool::Return()
dmConnectionPool::Shutdown()
ENUMS
dmConnectionPool::Result

result enumeration

Functions

dmConnectionPool::Close()

dmConnectionPool::Close(pool,connection)

Close connection. Use this function whenever an error occur in eg http.

PARAMETERS

pool

dmConnectionPool::HPool pool

connection

dmConnectionPool::HConnection


dmConnectionPool::Delete()

dmConnectionPool::Delete(pool)

Delete connnection pool

PARAMETERS

pool

dmConnectionPool::HPool pool

RETURNS

dmConnectionPool::RESULT_OK

on success


dmConnectionPool::Dial()

dmConnectionPool::Dial(pool,host,port,dns_channel,ssl,timeout,connection,sock_res)

Connection to a host/port

PARAMETERS

pool

dmConnectionPool::HPool pool

host

const char* host

port

uint16_t port

dns_channel

dmDNS::HChannel The DNS channel that will be used for translating the host to an address

ssl

bool true for ssl connection

timeout

int The timeout (micro seconds) for the connection and ssl handshake

connection

dmConnectionPool::HConnection* connection (out)

sock_res

dmSocket::Result* socket-result code on failure

RETURNS

dmConnectionPool::RESULT_OK

on success


dmConnectionPool::GetSSLSocket()

dmConnectionPool::GetSSLSocket(pool,connection)

Get secure socket.

PARAMETERS

pool

dmConnectionPool::HPool pool

connection

dmConnectionPool::HConnection

RETURNS

[type:dmSSLSocket::Socket]

on success


dmConnectionPool::GetSocket()

dmConnectionPool::GetSocket(pool,connection)

Get socket for connection

PARAMETERS

pool

dmConnectionPool::HPool pool

connection

dmConnectionPool::HConnection

RETURNS

[type:dmSocket::Socket]

on success


dmConnectionPool::New()

dmConnectionPool::New(params,pool)

Create a new connection pool

PARAMETERS

params
pool

dmConnectionPool::HPool* pool (out)

RETURNS

dmConnectionPool::RESULT_OK

on success


dmConnectionPool::Return()

dmConnectionPool::Return(pool,connection)

Return connection to pool

PARAMETERS

pool

dmConnectionPool::HPool pool

connection

dmConnectionPool::HConnection


dmConnectionPool::Shutdown()

dmConnectionPool::Shutdown(pool,how)

Shuts down all open sockets in the pool and block new connection attempts. The function can be called repeatedly on the same pool until it returns no more connections in use.

PARAMETERS

pool

dmConnectionPool::HPool pool

how

dmSocket::ShutdownType shutdown type to pass to socket shutdown function

RETURNS

current

number of connections in use


Enums

dmConnectionPool::Result

result enumeration

Result enumeration.

dmConnectionPool::RESULT_OK

0

dmConnectionPool::RESULT_OUT_OF_RESOURCES

-1

dmConnectionPool::RESULT_SOCKET_ERROR

-2

dmConnectionPool::RESULT_HANDSHAKE_FAILED

-3

dmConnectionPool::RESULT_SHUT_DOWN

-4