Helper functions for connecting BSD sockets. More...
Functions | |
| adbus_Socket | adbus_sock_connect (adbus_BusType type) |
| Connects a BSD socket to the specified bus type. | |
| adbus_Socket | adbus_sock_bind (adbus_BusType type) |
| Binds a BSD socket to the specified bus type. | |
| adbus_Socket | adbus_sock_connect_s (const char *envstr, int size) |
| Connects a BSD socket to the specified address. | |
| adbus_Socket | adbus_sock_bind_s (const char *envstr, int size) |
| Binds a BSD socket to the specified address. | |
| int | adbus_sock_cauth (adbus_Socket sock, adbus_Buffer *buffer) |
| Run the client auth protocol for a blocking BSD socket. | |
Helper functions for connecting BSD sockets.
| adbus_Socket adbus_sock_bind | ( | adbus_BusType | type | ) |
Binds a BSD socket to the specified bus type.
The address is looked up using adbus_bind_address(). Supported addresses are given by adbus_sock_bind_s().
| adbus_Socket adbus_sock_bind_s | ( | const char * | envstr, | |
| int | size | |||
| ) |
Binds a BSD socket to the specified address.
Supported address types are:
For TCP: specifying a port of 0 will cause the underlying sockets API to choose a random available port. The chosen port can be found by using getsockname() on the returned socket.
For example:
adbus_Socket s = adbus_sock_bind_s("tcp:host=localhost,port=12345", -1);
| int adbus_sock_cauth | ( | adbus_Socket | sock, | |
| adbus_Buffer * | buffer | |||
| ) |
Run the client auth protocol for a blocking BSD socket.
This includes sending the leading null byte.
For example:
int main(int argc, char* argv[]) { adbus_Socket s = adbus_sock_connect(ADBUS_DEFAULT_BUS); if (s == ADBUS_SOCK_INVALID || adbus_sock_cauth(s)) return -1; ... use the socket }
| adbus_Socket adbus_sock_connect | ( | adbus_BusType | type | ) |
Connects a BSD socket to the specified bus type.
The address is looked up using adbus_connect_address(). Supported addresses is given by adbus_sock_connect_s().
| adbus_Socket adbus_sock_connect_s | ( | const char * | envstr, | |
| int | size | |||
| ) |
Connects a BSD socket to the specified address.
Supported address types are:
For example:
adbus_Socket s = adbus_sock_connect_s("tcp:host=localhost,port=12345", -1);
1.6.1