Added a getter for the tls_socket file descriptor
This commit is contained in:
@@ -175,6 +175,12 @@ METHOD(tls_socket_t, write_, bool,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
METHOD(tls_socket_t, get_fd, int,
|
||||
private_tls_socket_t *this)
|
||||
{
|
||||
return this->fd;
|
||||
}
|
||||
|
||||
METHOD(tls_socket_t, destroy, void,
|
||||
private_tls_socket_t *this)
|
||||
{
|
||||
@@ -195,6 +201,7 @@ tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
|
||||
.public = {
|
||||
.read = _read_,
|
||||
.write = _write_,
|
||||
.get_fd = _get_fd,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
.app = {
|
||||
|
||||
@@ -54,6 +54,13 @@ struct tls_socket_t {
|
||||
*/
|
||||
bool (*write)(tls_socket_t *this, chunk_t data);
|
||||
|
||||
/**
|
||||
* Get the underlying file descriptor passed to the constructor.
|
||||
*
|
||||
* @return file descriptor
|
||||
*/
|
||||
int (*get_fd)(tls_socket_t *this);
|
||||
|
||||
/**
|
||||
* Destroy a tls_socket_t.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user