1.11.0 - No connection could be made because the target machine actively refused it

Discussion in 'Archive' started by Snoopy87, January 9, 2015.

  1. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    Hi,

    I am using MediaPortal 1.8 and 1.9 and MPExtened. With my own application I control MediaPortal TV with MPExtended to tune a channel and retrieve the stream.

    This is happening fine without any issues. But sometimes it suddenly don't work anymore and then TVService.exe is also not running anymore without any log entry why it is not running anymore.

    Best regards,
    Sascha


     

    Attached Files:

    • tv service.txt
      File size:
      458.3 KB
      Uploaded:
      January 9, 2015
      Views:
      205
    • Agree Agree x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hello Sascha :)

    If an application is crashing then usually the only way to figure out the cause is to attach a debugger or check what the Windows application event log says. It is difficult to help you without the application event log from your server. The watchdog/debug-tool includes the application event log, which is why I ask people to use it whenever possible.

    In short: please can you either post logs using the watchdog/debug-tool, or export and post the application event log, or check the application event log yourself.

    Regards,
    mm
     
  4. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    Sorry, I didn't find anything usefull in other log files and event viewer, that's why I didn't upload them.

    I attached them to this post.
     
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    The system event log shows:
    ...but no detail is shown in the application event log. Very odd.
    Is there no additional detail in the system event log?
    Do you have any kind of security software installed that could be interfering?
     
  6. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    Hi :)

    It's not my PC. It's a clean Windows 7 installation. No additional security software is installed.

    This is my code:

    Code (C):
    1.    
    2.   string initUrl = string.Format("http://{0}:{3}/MPExtended/StreamingService/json/InitStream?type=12&provider=0&itemId={1}&clientDescription=Test&identifier={2}", settings.IP, settings.Channel, identifier, settings.Port);
    3.        
    4.             string activeTvCards = string.Format("http://{0}:{1}/MPExtended/TVAccessService/json/GetActiveCards", settings.IP, settings.Port);
    5.          
    6.  
    7.             try
    8.             {
    9.                 var wr = System.Net.HttpWebRequest.Create(initUrl);
    10.              
    11.                 var r = wr.GetResponse();
    12.  
    13.                 wr = System.Net.HttpWebRequest.Create(activeTvCards);
    14.              
    15.                 r = wr.GetResponse();
    16.  
    17.                 string jsonString = string.Empty;
    18.                 using (var stream = new StreamReader(r.GetResponseStream()))
    19.                 {
    20.                     jsonString = stream.ReadToEnd();
    21.                 }
    22.                 var jsonObject = Newtonsoft.Json.Linq.JArray.Parse(jsonString);
    23.                 var streamingUrl = jsonObject.Where(j => j["ChannelId"].ToString() == settings.Channel.ToString() && j["User"]["Name"].ToString() == "mpextended-" + identifier).Select(u => u["RTSPUrl"].ToString()).FirstOrDefault();
    24.  
    25.  
    26.                 mediaElement.Source = new Uri(streamingUrl);
    27.                 mediaElement.Play();
    28.             }
    29.             catch
    30.             {
    31.                 Stop();
    32.                 throw;
    33.             }
    34.  
    And after a few minutes I call:

    Code (C):
    1.  
    2.   mediaElement.Stop();
    3.   mediaElement.Source = null;
    4.   mediaElement.Close();
    5.  
    6.   string endUrl = string.Format("[URL]http://{0}:{2}/MPExtended/StreamingService/json/FinishStream?identifier={1[/URL]}", settings.IP, identifier, settings.Port);
    7.   var wr = System.Net.HttpWebRequest.Create(endUrl);
    8.  
    9.   wr.GetResponse();
    10.  
    Then after a few minutes I call the first code (with a new MediaElement), and so on...

    This is working great for hours without any issues. But on that machine (which was set up new a few times, and also we tried different tv cards) after some time it is not working anymore and MPExtended is logging the above error and TVService is not running anymore. No other application is running and no user is interacting with the PC.

    Best regards,
    Sascha
     
  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hello Sascha

    I can't help with MPExtended; only with TV Server.
    I don't think the problem is related to tuners.
    Probably the only other thing that I can add is that in my opinion you should be Close()'ing/Dispose()'ing your HTTP web responses. In my own code I've experienced problems trying to create new requests if I don't properly close the old responses.

    Sorry I can't be more helpful,
    mm
     
    • Thank You! Thank You! x 1
  8. johanj
    • Premium Supporter

    johanj Well-Known Member

    Joined:
    January 31, 2009
    Messages:
    781
    Likes Received:
    270
    Gender:
    Male
    Ratings:
    +398 / 1
    Home Country:
    Sweden Sweden
    I sometimes have the same issue after streaming tv to MediaPortal iViewer. MPExtended reports no connection to tv-service when it happens. At those times the tv-server works since I can watch tv inside MP. MPExt and MP on same pc. So it could be that MPExtended failed to close/dispose.
     
  9. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hmmm, your experience sounds a bit different Johan... because unless I have misunderstood, the TV service actually crashes in Sascha's case, but without any entry in the Windows application or system event logs to tell us why the crash happens. However in your case the TV service never crashes, right?
     
  10. johanj
    • Premium Supporter

    johanj Well-Known Member

    Joined:
    January 31, 2009
    Messages:
    781
    Likes Received:
    270
    Gender:
    Male
    Ratings:
    +398 / 1
    Home Country:
    Sweden Sweden
    Yes, Im quite sure that the tv-service didnt crash, only MPExt connection to tv-service. I will check the status of tv-service and all the cards the next time it happens.
     
    • Thank You! Thank You! x 1
  11. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    Hi,

    attached is a sample project. Please run it, enter the IP address, port and channel id and click on "Start". This will create a loop where the channel is streamed for a few seconds, stopped and streamed again. After 5,10 or 30 minutes it crashes (due to missing exception handling). At this moment the MediaPortal TV Server is not running anymore (crashed without any error message!) and MPExtended is also logging an error.

    Attached you will also find the log files of my test.

    Please make sure that you have installed the DirectX March 2009 Runtime: http://www.microsoft.com/download/details.aspx?id=19743 and of course MPExtended on your server side.

    Thanks a lot and best regards,
    Sascha
     

    Attached Files:

Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!