Skip to content

Commit b36164b

Browse files
author
Jason Mobarak
authored
allow tcpsvr:// to bind to a particular address (#51)
1 parent 8e3daee commit b36164b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,9 @@ static int gentcp(tcp_t *tcp, int type, char *msg)
10791079
tcp->addr.sin_port=htons(tcp->port);
10801080

10811081
if (type==0) { /* server socket */
1082+
1083+
if (strlen(tcp->saddr) != 0)
1084+
tcp->addr.sin_addr.s_addr = inet_addr(tcp->saddr);
10821085

10831086
#ifdef SVR_REUSEADDR
10841087
/* multiple-use of server socket */

0 commit comments

Comments
 (0)