diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2010-10-19 21:23:13 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2010-10-19 21:23:13 -0700 |
commit | 1e8b5ea2cd2415e8c9ca2c5cb36d3d76071f8f76 (patch) | |
tree | 7a84e9c31f653ef75e648f403d6e1b8e1a658d9c /common/trans.c | |
parent | bb7898419fea4648d7038ff78037df24a271b491 (diff) | |
download | xrdp-proprietary-1e8b5ea2cd2415e8c9ca2c5cb36d3d76071f8f76.tar.gz xrdp-proprietary-1e8b5ea2cd2415e8c9ca2c5cb36d3d76071f8f76.zip |
bind to specific address
Diffstat (limited to 'common/trans.c')
-rw-r--r-- | common/trans.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/trans.c b/common/trans.c index 84b44b72..681174ac 100644 --- a/common/trans.c +++ b/common/trans.c @@ -342,7 +342,7 @@ trans_connect(struct trans* self, const char* server, const char* port, /*****************************************************************************/ int APP_CC -trans_listen(struct trans* self, char* port) +trans_listen_address(struct trans* self, char* port, const char* address) { if (self->sck != 0) { @@ -352,7 +352,7 @@ trans_listen(struct trans* self, char* port) { self->sck = g_tcp_socket(); g_tcp_set_non_blocking(self->sck); - if (g_tcp_bind(self->sck, port) == 0) + if (g_tcp_bind_address(self->sck, port, address) == 0) { if (g_tcp_listen(self->sck) == 0) { @@ -385,6 +385,13 @@ trans_listen(struct trans* self, char* port) } /*****************************************************************************/ +int APP_CC +trans_listen(struct trans* self, char* port) +{ + return trans_listen_address(self, port, "0.0.0.0"); +} + +/*****************************************************************************/ struct stream* APP_CC trans_get_in_s(struct trans* self) { |