- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Typedefs | Enumerations | Functions
Ecore Connection Library Functions
Ecore_Con - Connection functions

Utility functions that set up and shut down the Ecore Connection library. More...

## Typedefs
typedef void(* | Ecore_Con_Dns_Cb )(const char *canonname, const char *ip, struct sockaddr *addr, int addrlen, void *data)
| A callback type for use with ecore_con_lookup.
typedef enum _Ecore_Con_Type | Ecore_Con_Type

## Enumerations
enum | _Ecore_Con_Type { ECORE_CON_LOCAL_USER = 0, ECORE_CON_LOCAL_SYSTEM = 1, ECORE_CON_LOCAL_ABSTRACT = 2, ECORE_CON_REMOTE_TCP = 3, ECORE_CON_REMOTE_MCAST = 4, ECORE_CON_REMOTE_UDP = 5, ECORE_CON_REMOTE_BROADCAST = 6, ECORE_CON_REMOTE_NODELAY = 7, ECORE_CON_REMOTE_CORK = 8, ECORE_CON_USE_SSL2 = (1 << 4), ECORE_CON_USE_SSL3 = (1 << 5), ECORE_CON_USE_TLS = (1 << 6), ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS, ECORE_CON_LOAD_CERT = (1 << 7), ECORE_CON_NO_PROXY = (1 << 8), ECORE_CON_SOCKET_ACTIVATE = (1 << 9) }
| Types for an ecore_con client/server object. More...

## Functions
EAPI int | ecore_con_init (void)
| Initialises the Ecore_Con library. More...
EAPI int | ecore_con_shutdown (void)
| Shuts down the Ecore_Con library. More...
EAPI Eina_Bool | ecore_con_lookup (const char *name, Ecore_Con_Dns_Cb done_cb, const void *data)
| Do an asynchronous DNS lookup. More...

## Detailed Description

Utility functions that set up and shut down the Ecore Connection library.

There's also ecore_con_lookup() that can be used to make simple asynchronous DNS lookups.

A simple example of how to use these functions:

- Ecore_Con - DNS lookup

## Enumeration Type Documentation

enum _Ecore_Con_Type

Types for an ecore_con client/server object.

A correct way to set this type is with an ECORE_CON_$TYPE, optionally OR'ed with an ECORE_CON_$USE if encryption is desired, and LOAD_CERT if the previously loaded certificate should be used.

ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_LOAD_CERT

Enumerator
ECORE_CON_LOCAL_USER | Socket in ~/.ecore.
ECORE_CON_LOCAL_SYSTEM | Socket in /tmp.
ECORE_CON_LOCAL_ABSTRACT | Abstract socket.
ECORE_CON_REMOTE_TCP | Remote server using TCP.
ECORE_CON_REMOTE_MCAST | Remote multicast server.
ECORE_CON_REMOTE_UDP | Remote server using UDP.
ECORE_CON_REMOTE_BROADCAST | Remote broadcast using UDP.
ECORE_CON_REMOTE_NODELAY | Remote connection sending packets immediately.
ECORE_CON_REMOTE_CORK | Remote connection sending data in large chunks. Note Only available on Linux Since 1.2
ECORE_CON_USE_SSL2 | Use SSL2: UNSUPPORTED.
ECORE_CON_USE_SSL3 | Use SSL3.
ECORE_CON_USE_TLS | Use TLS.
ECORE_CON_USE_MIXED | Use both TLS and SSL3.
ECORE_CON_LOAD_CERT | Attempt to use the loaded certificate.
ECORE_CON_NO_PROXY | Disable all types of proxy on the server. Note Only functional for clients Since 1.2

## Function Documentation

EAPI int ecore_con_init | ( | void |  | ) |

Initialises the Ecore_Con library.

Returns
  Number of times the library has been initialised without being shut down.

Note
  This function already calls ecore_init() internally, so you don't need to call it explicitly.

References ecore_event_type_new(), ecore_init(), ecore_shutdown(), eina_log_domain_register(), EINA_LOG_ERR, eina_log_timing(), eina_magic_string_set(), and evil_init().

Referenced by ecore_ipc_init().

EAPI int ecore_con_shutdown | ( | void |  | ) |

Shuts down the Ecore_Con library.

Returns
  Number of times the library has been initialised without being shut down.

Note
  This function already calls ecore_shutdown() internally, so you don't need to call it explicitly unless you called ecore_init() explicitly too.

References ecore_shutdown(), EINA_LIST_FOREACH_SAFE, EINA_LIST_FREE, eina_log_domain_unregister(), eina_log_timing(), EINA_TRUE, and evil_shutdown().

Referenced by ecore_ipc_shutdown().

EAPI Eina_Bool ecore_con_lookup | ( | const char * | name,
|  | Ecore_Con_Dns_Cb | done_cb,
|  | const void * | data
| ) |  |

Do an asynchronous DNS lookup.

Parameters

  name | IP address or server name to translate.
  done_cb | Callback to notify when done.
  data | User data to be given to done_cb.

Returns
  `EINA_TRUE` if the request did not fail to be set up, `EINA_FALSE` if it failed.

This function performs a DNS lookup on the hostname specified by `name`, then calls `done_cb` with the result and the `data` given as parameter. The result will be given to the `done_cb` as follows:

- `canonname` - the canonical name of the address
- `ip` - the resolved ip address
- `addr` - a pointer to the socket address
- `addrlen` - the length of the socket address, in bytes
- `data` - the data pointer given as parameter to ecore_con_lookup()

References ECORE_CON_REMOTE_TCP, EINA_FALSE, and EINA_TRUE.

Referenced by ecore_con_server_connect().