Mercurial > mplayer.hg
comparison stream/tcp.c @ 26326:5bfc1d8bece9
Remove the need for code using stream to export an mp_input_check_interrupt()
function. It also removes the compile-time dependency on input.
author | albeu |
---|---|
date | Wed, 09 Apr 2008 00:36:28 +0000 |
parents | 44540930bf94 |
children | ba4a01eb4475 |
comparison
equal
deleted
inserted
replaced
26325:890180cde40f | 26326:5bfc1d8bece9 |
---|---|
17 | 17 |
18 #include "config.h" | 18 #include "config.h" |
19 | 19 |
20 #include "mp_msg.h" | 20 #include "mp_msg.h" |
21 #include "help_mp.h" | 21 #include "help_mp.h" |
22 #include "input/input.h" | |
23 | 22 |
24 #ifndef HAVE_WINSOCK2 | 23 #ifndef HAVE_WINSOCK2 |
25 #include <netdb.h> | 24 #include <netdb.h> |
26 #include <netinet/in.h> | 25 #include <netinet/in.h> |
27 #include <sys/socket.h> | 26 #include <sys/socket.h> |
193 tv.tv_usec = 500000; | 192 tv.tv_usec = 500000; |
194 FD_ZERO( &set ); | 193 FD_ZERO( &set ); |
195 FD_SET( socket_server_fd, &set ); | 194 FD_SET( socket_server_fd, &set ); |
196 // When the connection will be made, we will have a writeable fd | 195 // When the connection will be made, we will have a writeable fd |
197 while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) { | 196 while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) { |
198 if(count > 30 || mp_input_check_interrupt(500)) { | 197 if(count > 30 || stream_check_interrupt(500)) { |
199 if(count > 30) | 198 if(count > 30) |
200 mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnTimeout); | 199 mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnTimeout); |
201 else | 200 else |
202 mp_msg(MSGT_NETWORK,MSGL_V,"Connection interrupted by user\n"); | 201 mp_msg(MSGT_NETWORK,MSGL_V,"Connection interrupted by user\n"); |
203 return TCP_ERROR_TIMEOUT; | 202 return TCP_ERROR_TIMEOUT; |