[svn r277] Fixed gmyth_socket_new() interface change trunk
authormelunko
Thu Jan 18 21:03:14 2007 +0000 (2007-01-18)
branchtrunk
changeset 276ed5172cf0f1b
parent 275 d2192075f563
child 277 890b023c759f
[svn r277] Fixed gmyth_socket_new() interface change
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_monitor_handler.c
gmyth/src/gmyth_recorder.c
gmyth/src/gmyth_scheduler.c
gmyth/src/gmyth_socket.c
gmyth/src/gmyth_socket.h
gmyth/src/gmyth_util.c
gmyth/tests/gmyth_test_recorder.c
     1.1 --- a/gmyth/src/gmyth_file_transfer.c	Thu Jan 18 20:51:59 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_file_transfer.c	Thu Jan 18 21:03:14 2007 +0000
     1.3 @@ -282,7 +282,7 @@
     1.4      transfer->control_sock = NULL;
     1.5    }
     1.6  
     1.7 -  transfer->control_sock = gmyth_socket_new(6543);
     1.8 +  transfer->control_sock = gmyth_socket_new();
     1.9  
    1.10    // Connects the socket, send Mythtv ANN command and verify Mythtv protocol version 
    1.11    if (!gmyth_socket_connect_to_backend (transfer->control_sock,
    1.12 @@ -299,7 +299,7 @@
    1.13      transfer->sock = NULL;
    1.14    }
    1.15  
    1.16 -  transfer->sock = gmyth_socket_new (6543);
    1.17 +  transfer->sock = gmyth_socket_new ();
    1.18    gmyth_socket_connect (transfer->sock, transfer->backend_info->hostname, transfer->backend_info->port);
    1.19  
    1.20    strlist = gmyth_string_list_new();
     2.1 --- a/gmyth/src/gmyth_livetv.c	Thu Jan 18 20:51:59 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_livetv.c	Thu Jan 18 21:03:14 2007 +0000
     2.3 @@ -235,7 +235,7 @@
     2.4  {
     2.5  	gboolean res = TRUE;
     2.6  
     2.7 -	GMythSocket *socket = gmyth_socket_new (6543);
     2.8 +	GMythSocket *socket = gmyth_socket_new ();
     2.9  	
    2.10  	livetv->backend_info = backend_info;
    2.11  
     3.1 --- a/gmyth/src/gmyth_monitor_handler.c	Thu Jan 18 20:51:59 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_monitor_handler.c	Thu Jan 18 21:03:14 2007 +0000
     3.3 @@ -475,7 +475,7 @@
     3.4  {
     3.5    gboolean ret = TRUE;
     3.6  
     3.7 -  monitor->event_sock = gmyth_socket_new(6543);
     3.8 +  monitor->event_sock = gmyth_socket_new();
     3.9  
    3.10    /* Connects the socket, send Mythtv ANN Monitor and verify Mythtv protocol version */ 
    3.11    if (!gmyth_socket_connect_to_backend_events ( monitor->event_sock,
     4.1 --- a/gmyth/src/gmyth_recorder.c	Thu Jan 18 20:51:59 2007 +0000
     4.2 +++ b/gmyth/src/gmyth_recorder.c	Thu Jan 18 21:03:14 2007 +0000
     4.3 @@ -118,7 +118,7 @@
     4.4  
     4.5  	if (recorder->myth_socket == NULL) {
     4.6  		
     4.7 -		recorder->myth_socket = gmyth_socket_new (6543);
     4.8 +		recorder->myth_socket = gmyth_socket_new ();
     4.9  		
    4.10  		if (!gmyth_socket_connect_to_backend ( recorder->myth_socket, recorder->hostname->str, 
    4.11  					recorder->port, TRUE ) ) {
     5.1 --- a/gmyth/src/gmyth_scheduler.c	Thu Jan 18 20:51:59 2007 +0000
     5.2 +++ b/gmyth/src/gmyth_scheduler.c	Thu Jan 18 21:03:14 2007 +0000
     5.3 @@ -624,7 +624,7 @@
     5.4      g_string_append_printf (datastr, "%d", record_id);
     5.5      gmyth_string_list_append_string (strlist, datastr);
     5.6  
     5.7 -    socket = gmyth_socket_new (6543);
     5.8 +    socket = gmyth_socket_new ();
     5.9      if (gmyth_socket_connect (socket, scheduler->backend_info->hostname,
    5.10  			    scheduler->backend_info->port)) {
    5.11          gmyth_socket_sendreceive_stringlist (socket, strlist);
     6.1 --- a/gmyth/src/gmyth_socket.c	Thu Jan 18 20:51:59 2007 +0000
     6.2 +++ b/gmyth/src/gmyth_socket.c	Thu Jan 18 21:03:14 2007 +0000
     6.3 @@ -408,12 +408,10 @@
     6.4   * @return a new instance of GMythSocket.
     6.5   */
     6.6  GMythSocket*
     6.7 -gmyth_socket_new (int port)
     6.8 +gmyth_socket_new ()
     6.9  {
    6.10      GMythSocket *gmyth_socket = GMYTH_SOCKET (g_object_new(GMYTH_SOCKET_TYPE, NULL));
    6.11  
    6.12 -    gmyth_socket->port = port;
    6.13 -    
    6.14      gmyth_socket->mythtv_version = MYTHTV_VERSION_DEFAULT;
    6.15  
    6.16      return gmyth_socket;
    6.17 @@ -473,7 +471,6 @@
    6.18  	  FD_ZERO( &fd_w );
    6.19  	  FD_SET( fd, &fd_w );
    6.20  	
    6.21 -	  gmyth_debug ("xxxxxxxxxxxx %ld\n", timeout->tv_sec);
    6.22  	  *err = select( FD_SETSIZE, NULL, &fd_w, NULL, timeout);
    6.23  	  if ( *err < 0 ) {
    6.24  	    g_warning( "[%s] Connection unsucessfull (timed out).\n", __FUNCTION__ );
    6.25 @@ -565,12 +562,10 @@
    6.26  	    /*timeout_val = g_new0 (struct timeval, 1);*/
    6.27  	    
    6.28              timeout_val->tv_sec = timeout;
    6.29 -	    gmyth_debug ("XXXXXXXXXXX setting timeout %ld\n", timeout_val->tv_sec);
    6.30              timeout_val->tv_usec = 0;
    6.31  	} else {
    6.32 -      timeout_val->tv_sec = 5;
    6.33 -	    gmyth_debug ("XXXXXXXXXXX timeout is ZERO. Setting timeout to the default value of 5 seconds, 100 microseconds -> %ld\n", timeout_val->tv_sec);
    6.34 -      timeout_val->tv_usec = 100;
    6.35 +            timeout_val->tv_sec = 5;
    6.36 +            timeout_val->tv_usec = 100;
    6.37  	}
    6.38          
    6.39          if (gmyth_socket_try_connect (gmyth_socket->sd, (struct sockaddr *)addr_info0->ai_addr,
     7.1 --- a/gmyth/src/gmyth_socket.h	Thu Jan 18 20:51:59 2007 +0000
     7.2 +++ b/gmyth/src/gmyth_socket.h	Thu Jan 18 21:03:14 2007 +0000
     7.3 @@ -82,7 +82,7 @@
     7.4  
     7.5  GType           gmyth_socket_get_type (void);
     7.6  
     7.7 -GMythSocket *   gmyth_socket_new (gint port);
     7.8 +GMythSocket *   gmyth_socket_new ();
     7.9  
    7.10  gboolean        gmyth_socket_connect (GMythSocket *gmyth_socket, const gchar *hostname, gint port);
    7.11  
     8.1 --- a/gmyth/src/gmyth_util.c	Thu Jan 18 20:51:59 2007 +0000
     8.2 +++ b/gmyth/src/gmyth_util.c	Thu Jan 18 21:03:14 2007 +0000
     8.3 @@ -420,7 +420,7 @@
     8.4      GMythSocket *socket;
     8.5      gboolean res;
     8.6      
     8.7 -    socket = gmyth_socket_new (6543);
     8.8 +    socket = gmyth_socket_new ();
     8.9      res = gmyth_socket_connect_to_backend (socket, backend_info->hostname,
    8.10  		    backend_info->port, TRUE);
    8.11  
     9.1 --- a/gmyth/tests/gmyth_test_recorder.c	Thu Jan 18 20:51:59 2007 +0000
     9.2 +++ b/gmyth/tests/gmyth_test_recorder.c	Thu Jan 18 21:03:14 2007 +0000
     9.3 @@ -108,7 +108,10 @@
     9.4  
     9.5      backend_info = gmyth_backend_info_new_with_uri (argv[1]);
     9.6  
     9.7 +    printf ("******** Testing recorder availability ***********\n");
     9.8      test_recorder_availability (backend_info);
     9.9 +
    9.10 +    printf ("******** Testing recorder check channels function ***********\n");
    9.11      test_recorder_check_channels (backend_info);
    9.12  }
    9.13