Update of /cvsroot/playerstage/code/player/libplayertcp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21429/libplayertcp
Modified Files:
playertcp.cc socket_util.c socket_util.h
Log Message:
Index: playertcp.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/playertcp.cc,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** playertcp.cc 21 Sep 2007 21:41:00 -0000 1.62
--- playertcp.cc 21 Sep 2007 22:02:06 -0000 1.63
***************
*** 181,185 ****
{
if((this->listeners[i].fd =
! create_and_bind_socket(1,this->host,ports[i],
PLAYER_TRANSPORT_TCP,200)) < 0)
{
--- 181,185 ----
{
if((this->listeners[i].fd =
! create_and_bind_socket(1,this->host,ports+i,
PLAYER_TRANSPORT_TCP,200)) < 0)
{
Index: socket_util.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/socket_util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** socket_util.h 10 Jul 2007 09:01:52 -0000 1.3
--- socket_util.h 21 Sep 2007 22:02:06 -0000 1.4
***************
*** 77,81 ****
*/
int create_and_bind_socket(char blocking, unsigned int host,
! int portnum, int socktype, int backlog);
#ifdef __cplusplus
}
--- 77,81 ----
*/
int create_and_bind_socket(char blocking, unsigned int host,
! int* portnum, int socktype, int backlog);
#ifdef __cplusplus
}
Index: socket_util.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/socket_util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** socket_util.c 10 Jul 2007 09:01:52 -0000 1.3
--- socket_util.c 21 Sep 2007 22:02:06 -0000 1.4
***************
*** 83,87 ****
int
! create_and_bind_socket(char blocking, unsigned int host, int portnum,
int playersocktype, int backlog)
{
--- 83,87 ----
int
! create_and_bind_socket(char blocking, unsigned int host, int* portnum,
int playersocktype, int backlog)
{
***************
*** 106,110 ****
memset(&serverp,0,sizeof(serverp));
serverp.sin_addr.s_addr = host;
! serverp.sin_port = htons(portnum);
/*
--- 106,110 ----
memset(&serverp,0,sizeof(serverp));
serverp.sin_addr.s_addr = host;
! serverp.sin_port = htons(*portnum);
/*
***************
*** 184,187 ****
--- 184,190 ----
}
+ // Copy back the selected port (in case the OS changed it)
+ *portnum = ntohs(serverp.sin_port);
+
/* if it's TCP, go ahead with listen() */
if(socktype == SOCK_STREAM)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit