Results 1 to 7 of 7

Thread: How to terminate a HTTP Session when it is stilll running?

  1. #1

    Default How to terminate a HTTP Session when it is stilll running?

    Hi everyone,

    I want to terminate a http session which is running.
    How can I do that.

    Thank you.

  2. #2

  3. #3

    Default

    I want to close a http Session which is running.

    In my case, I use userid is a parameter in the url. I want to close the first http session when the second http session is created. The first and second http session have the same userid.
    For my instance, I request the first stream with http://wowza-server:1935/live/Stream...m3u8?us=123456
    And then, I also request the second stream with http://wowza-server:1935/live/Stream...m3u8?us=123456.

    How to Wowza Server close the first http Session, when the second http Session is created.

    Hungnguyen

  4. #4
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Hungnguyen,

    You can do something like this:

    String userID="123";
       List<IHTTPStreamerSession> HTTPClients = ThisAppIns.getHTTPStreamerSessions();
       Iterator<IHTTPStreamerSession> HTTPClientIter = HTTPClients.iterator();
       IHTTPStreamerSession ThisHTTPClient;
              while ( HTTPClientIter.hasNext() )  
                    {  
                           ThisHTTPClient = HTTPClientIter.next();
                           if (userID.equalsIgnoreCase(ThisHTTPClient.getQueryStr()))
                        		   {
    						   ThisHTTPClient.rejectSession();
    						   ThisHTTPClient.shutdown();
                        		   }  
                    }
    Richard

  5. #5

    Default

    Hi Richard,

    I follow your guide, but it also kills the current session.
    I have fix like that

    List<IHTTPStreamerSession> HTTPClients = appInstance
    .getHTTPStreamerSessions();
    Iterator<IHTTPStreamerSession> HTTPClientIter = HTTPClients.iterator();
    IHTTPStreamerSession ThisHTTPClient;
    
    getLogger().info("HTTPClients size: "  + HTTPClients.size());
    
    while  (HTTPClientIter.hasNext()) {
    
    ThisHTTPClient = HTTPClientIter.next(); if (arrParams[0].equalsIgnoreCase(ThisHTTPClient.getQueryStr()) && !ThisHTTPClient.getSessionId().equals(httpSession.getSessionId()) ) {
    ThisHTTPClient.rejectSession(); ThisHTTPClient.shutdown();
    }
    }
    And it works properly.
    Thank you very much.

    Hungnguyen
    Last edited by hungnguyen88; 04-24-2014 at 03:05 AM.

  6. #6

    Default

    Hi Richard,

    I have another issue, I have a media system with multi Edge servers. Such as what I discribe above, when the second http session is created, the first http session is closed. However, it 's just useful on the same edge server.
    How about multi edge servers?

    Hungnguyen

  7. #7
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Hungnguyen,

    There is nothing built-in to support that. Assuming you are using the Load Balancer, that would be a likely place to manage connections. You might use SharedObjects or HashMap in a HTTPProvider, which would be the entry point for HTTP playback clients. You check check querystring > accept (reject) > check Load Balancer for least loaded server > Return html with video tag and playback URL.

    Richard

Similar Threads

  1. HTTP Cupertino session Reject
    By pirateMan in forum Server-side Modules and Code Samples Discussion
    Replies: 7
    Last Post: 09-09-2014, 05:44 AM
  2. About HTTP session timeout problem
    By Roy0817 in forum General Forum
    Replies: 3
    Last Post: 03-14-2013, 07:47 AM
  3. HTTP Session never destroy
    By weichung in forum General Forum
    Replies: 6
    Last Post: 01-15-2013, 09:47 AM
  4. http session stream change
    By notreg in forum Server-side Modules and Code Samples Discussion
    Replies: 2
    Last Post: 05-28-2012, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •