Detect Client Disconnect When using RTMP

Hello,
I hava a Java Server and Clients using RTMP. I've read somewhere that I can detect instantly client disconnection when using RTMP. However I cannot find an example code (in Java) that demonstrates this functionality? Can you help me please?

I am not sure how your client looks, however the lient connect using NetConnection under the hood which spits NetStatusEvents's and you can listen to them ...
C

Similar Messages

  • Detecting client disconnects

    What's the best way to detect a client loss of connection? I've heard
    you can register for weblogic.accounting.disconnect events or used the
    workspace destroyMonitor method. Which is preferred? The events method
    concerns me because I don't believe it will be supported in the future
    once JMS takes a foothold. Is this a valid concern? Are there any new
    ways to do this?
    thanks,
    Edwin

    I would suggest you try catching java.net.SocketException (Connection reset
              by peer: socket write error) in you doGet/doPost method. This is not a sure
              way though ...
              --- Igor Zavialov
              "Dylan Taffe" <[email protected]> wrote in message
              news:3a5393d6$[email protected]..
              > Does anyone know of a way to detect client disconnects with servlets?
              Does
              > the contextEventListener or any other event listener get called when a
              > clients kills its connection with the weblogic server?
              >
              >
              

  • Some RST are seen during TCP disconnection when using SSL connection

    Some RST are seen during TCP disconnection when using SSL connection
    It is expected that the disconnection sequence for a secure connection to be as follow:
    client ************************* server
    --- alert (warning, close notify) --->
    <--- alert (warning, close notify) ---
    in any order;
    and then:-
    --------------- FIN, ACK ------------>
    <----------- FIN, ACK ---------------
    ------------------ ACK ----------------->
    Instead of the sequence described above, the TCP connection for a secure connection is closed with an RST.
    For instance, Wireshark capture shows that an SSL+SASL TCP connection is closed in the following manner:
    client ************************** server
    --- alert (warning, close notify) ---->
    ---------------- FIN, ACK ------------>
    <--- alert (warning, close notify) ---
    <----------- FIN, ACK ---------------------
    ------------ RST -----------------> *(This RST message should be investigated, an ACK message was expected)*
    Server: OpenLDAP: slapd 2.4.23
    Client: (java version "1.6.0_16")
    import javax.naming.*;
    import javax.naming.directory.*;
    import javax.naming.ldap.InitialLdapContext;
    import java.util.Hashtable;
    import javax.naming.ldap.InitialLdapContext;
    import javax.naming.ldap.StartTlsRequest;
    import javax.naming.ldap.StartTlsResponse;
    class Client {
    private static final String DEFAULT_INITIAL_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory";
    public static void main(String[] args) {
    //SSL
    try {
    System.setProperty("javax.net.ssl.keyStore", "c:\\\keystore");
    System.setProperty("javax.net.ssl.keyStorePassword", "adminadmin");
    System.setProperty("javax.net.ssl.trustStore","c:\\\keystore");
    System.setProperty("javax.net.ssl.trustStorePassword","adminadmin");
    // Set up environment for creating initial context
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    // Must use the name of the server that is found in its certificate
    env.put(Context.PROVIDER_URL, "ldap://1.2.4.4:16415");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "cn=manager,dc=operator,dc=com");
    env.put(Context.SECURITY_CREDENTIALS, "password");
    env.put(Context.SECURITY_PROTOCOL, "ssl");
    // Create initial context
    InitialLdapContext ctx = new InitialLdapContext(env, null);
    // Close the context when we're done
    ctx.close();
    catch(Exception e)
    e.printStackTrace();
    Is it a bug ? Can I expect to have a patch for this issue?
    Regards,
    Olivier
    Edited by: 975464 on 6-Dec-2012 11:21 AM

    I agree it should be an ACK not an RST but it doesn't really matter. The connection is closed, and as neither the client nor the server has any pending data it is benign. Worth investigating in a later JRE.

  • Ichat, AIM, & Adium all frequently disconnect when using Air

    Ichat, AIM, & Adium all frequently disconnect when using Airport. I use a Linksys Wireless Router with an Airport extreme card. When directly connected to the router, I have no problem. Using a PC with Windows XP, AIM operates fine. Safari and Firefox work fine, although sometimes I receive errors connecting to pages, when I try again no problem. Using any of the chat programs, I lose connection, but then can reconnect. After a few times, the AOL servers will prevent login.
    I use COMCAST Cable internet service. My wireless router uses WEP encryption. I would switch to an AIrport Base station, but doubt it would correct the problem.
    I have had this problem previously, but it corrected itself. now it is making chat programs unusable.
    Any ideas?

    Hi John,
    By default Linksys units normally have the IP address of 192.168.1.1
    Is this true for both your units or have you changed one of them ?
    You may only find this out if you connect directly to the Modem one.
    Also you have not said if only one of them is doing DHCP.
    Example pic 3 on this page. This shows this device as getting it own contact IP address by DHCP (like from your ISP). Further down the page in the pic it shows the device is also acting as a DHCP server to the local net.
    If your router is set up like this it could be getting an IP address usng DHCP like this device shows and that would tend to mean that the Modem is acting as a DHCP server as well.
    If both devices still have the default IP addresses you will have conflicts, which probably explians the problems you have.
    Ralph

  • Msi x99 gaming 9 ack does not detect capture card when using with xsplit

    msi x99 gaming 9 ack does not detect capture card when using with xsplit
    i install every but still it does not work.

    Hi
    It wasn&#39;t hard to find your motherboard version:
    http://www.msi.com/support/mb/Z68AGD80_B3.html#down-bios
    Since your BIOS is v20.1, it couldn&#39;t be G3 
    Apart from checking BIOS, you can only check motherboard or moth...

  • FMS auto disconnects when using a class

    I am trying to implement a very simple class that will create
    an instance of the NetConnection object and connect to the FMS
    server. However, the client will connect then immediately
    disconnect when the swf is published. My code is as follows...
    FLA Code:
    import _includes.*;
    var obj_conn:Conn = new Conn();
    obj_conn.connect();
    Conn.as Code:
    class _includes.Conn
    public function Conn()
    public function connect()
    var nc:NetConnection = new NetConnection();
    nc.connect("rtmp://localhost/classtest");
    Please note that the connection works fine if I just create a
    NetConnection variable on the FLA itself in the timeline. Any
    suggestions/help would be appriciated!

    it think this is happen because you use local variable : your
    variable is delete at the end of connect() so your NetConnection
    will be closed in the same time.
    try this:
    Conn.as Code:
    class _includes.Conn
    private var objNetCon:NetConnection;
    public function Conn()
    public function connect()
    this.objNetCon = new NetConnection();
    this.objNetCon.connect("rtmp://localhost/classtest");
    }

  • Detect client disconnection

    Hi.
    My Java Web Service works with ComPorts so I need to close it in a right way when a client disconnects.
    Is there a way to detect in the Web Service when a client disconnects.
    Thank�s you all!!

    So, i want to be able to find out if the client is disconnected without waiting to send or receive data.Use a read timeout.
    how can i change the value of SO_KEEPALIVEYou can't. It is two hours by default and requires privilege to change it, and changing it is system-wide. So you don't want to do that.
    Use a read timeout. Socket.setSoTimeout().

  • Blocking when using RTMPS

    While using RTMPS to push large amounts of data to the flash player we've begun seeing deadlock occurring in the FlexClient on the server.
    This is the usage:
    Destination A:
    pushes 1 message every 5 seconds containing an array of 500-5000 objects (each object ~300K)
    Destination B:
    pushes 1/message/second containing a small object (by small I mean it has at most 10 String or Number fields on them) onto a subtopic
    pushes 1/message every 30 seconds containing a list of 10 key-value pairs onto a second subtopic
    pushes 1/message every 30 seconds containing a list of 10 key-value pairs onto a third subtopic
    JConsole shows the FlexClient blocks in push().  We attached a debugger and found the RTMP endpoint has a tcMessageQueue that has all of the messages in it.  During normal execution this queue has 1 or 0 messages in it, but when the threads are blocking the queue grows.
    The app can run for several minutes before getting into a blocked state.  Other users are not blocked (they are using their own destinations).  The flash player itself remains responsive, but simply isn't getting any data.  I've looked at the BlazeDS source which shows synchronized blocks on "lock" and on "queue" but I can't see why either of those are blocking "forever".
    This is all running LCDS 2.6.1 on both linux and windows servers.  Does anybody have any similar issues?  Any suggestions on what's causing the FlexClient to block? 

    I tried to run it in a separate thread:
    executionMgr = new ExecutionManangementRunnable(listener, process);
                   Callable callable = Executors.callable(executionMgr, null);
                   FutureTask future = new FutureTask(callable);
                   Thread thread = new Thread(future);
                   thread.setDaemon(true);
                   thread.start();
                   try {
                        future.get(1, TimeUnit.MINUTES);
                   } catch (InterruptedException e) {
                        // TODO handle catch block
                        e.printStackTrace();
                   } catch (ExecutionException e) {
                        // TODO handle catch block
                        e.printStackTrace();
                   } catch (TimeoutException e) {
                        // TODO handle catch block
                        e.printStackTrace();
                   }I still get the same problem with main thread being blocked. Does anyone know why?'
    //mikael

  • Detecting transform errors when using org.xml.sax.XMLFilter

    I am using javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter to transform xml against a pipeline of stylesheets (See function testPipelineTransform in the example below). The process works okay, excepting that I cannot figure out how to detect errors in the transformation process.
    I would like to achieve the same result for the pipeline process as I would for a single transformation using javax.xml.transform.Transformer.setErrorListener. The example below demonstrates how the call to javax.xml.transform.Transformer.setErrorListener does not generate the same result when using org.xml.sax.XMLFilter as it does when using a single transformation.
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.xml.sax.XMLFilter;
    import javax.xml.transform.ErrorListener;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import java.io.*;
    public class FilterChain {
        static private final String newline = System.getProperty("line.separator");
         public static void main(String argv[]) {
              System.out.println("Testing pipeline transform");
              testPipelineTransform();
              System.out.println("Testing single transform");
              testXsltSingleTransform();
         } // main
         static private void testPipelineTransform() {
              try {
                   // Set up the input stream
                   BufferedInputStream bis = new BufferedInputStream(
                             new ByteArrayInputStream(getExample().getBytes()));
                   InputSource input = new InputSource(bis);
                   // Set up to read the input file
                   SAXParserFactory spf = SAXParserFactory.newInstance();
                   SAXParser parser = spf.newSAXParser();
                   XMLReader reader = parser.getXMLReader();
                   // Create the filters
                   SAXTransformerFactory stf = (SAXTransformerFactory) TransformerFactory
                             .newInstance();
                   XMLFilter filter1 = stf.newXMLFilter(new StreamSource(new StringReader(getStylesheet1())));
                   XMLFilter filter2 = stf.newXMLFilter(new StreamSource(new StringReader(getStylesheet2())));
                   // Wire the output of the reader to filter1
                   // and the output of filter1 to filter2
                   filter1.setParent(reader);
                   filter2.setParent(filter1);
                   // Set up the output stream
                   StreamResult result = new StreamResult(System.out);
                   // Set up the transformer to process the SAX events generated
                   // by the last filter in the chain
                   Transformer transformer = stf.newTransformer();
                   transformer.setErrorListener(new ErrorListener() {
                        public void error(TransformerException te)
                                  throws TransformerException {
                             System.out.println("Transform generated Transform Error");
                             System.out.println(te.getMessage());
                        public void fatalError(TransformerException te)
                                  throws TransformerException {
                             System.out
                                       .println("Transform generated Transform Fatal Error");
                             System.out.println(te.getMessage());
                        public void warning(TransformerException te)
                                  throws TransformerException {
                             System.out.println("Transform generated Transform Warning");
                             System.out.println(te.getMessage());
                   SAXSource transformSource = new SAXSource(filter2, input);
                   transformer.transform(transformSource, result);
              } catch (TransformerConfigurationException tce) {
                   // Error generated by the parser
                   System.out.println("\n** Transformer Factory error");
                   System.out.println("   " + tce.getMessage());
                   // Use the contained exception, if any
                   Throwable x = tce;
                   if (tce.getException() != null)
                        x = tce.getException();
                   x.printStackTrace();
              } catch (TransformerException te) {
                   // Error generated by the parser
                   System.out.println("\n** Transformation error");
                   System.out.println("   " + te.getMessage());
                   // Use the contained exception, if any
                   Throwable x = te;
                   if (te.getException() != null)
                        x = te.getException();
                   x.printStackTrace();
              } catch (SAXException sxe) {
                   // Error generated by this application
                   // (or a parser-initialization error)
                   Exception x = sxe;
                   if (sxe.getException() != null)
                        x = sxe.getException();
                   x.printStackTrace();
              } catch (ParserConfigurationException pce) {
                   // Parser with specified options can't be built
                   pce.printStackTrace();
         static private void testXsltSingleTransform() {
              try {
                   BufferedInputStream bis = new BufferedInputStream(
                             new ByteArrayInputStream(getExample().getBytes()));
                   // Set up the output stream
                   StreamResult result = new StreamResult(System.out);
                   InputSource input = new InputSource(bis);
                   TransformerFactory factory = TransformerFactory.newInstance();
                   Source source = new StreamSource(new StringReader(getStylesheet2()));
                   Transformer stylesheet = factory.newTransformer(source);
                   stylesheet.setErrorListener(new ErrorListener() {
                        public void error(TransformerException te)
                                  throws TransformerException {
                             System.out.println("Transform generated Transform Error");
                             System.out.println(te.getMessage());
                        public void fatalError(TransformerException te)
                                  throws TransformerException {
                             System.out
                                       .println("Transform generated Transform Fatal Error");
                             System.out.println(te.getMessage());
                        public void warning(TransformerException te)
                                  throws TransformerException {
                             System.out.println("Transform generated Transform Warning");
                             System.out.println(te.getMessage());
                   SAXSource transformSource = new SAXSource(input);
                   stylesheet.transform(transformSource, result);
              } catch (Exception exc) {
                   exc.printStackTrace();
         private static String getStylesheet1() {
              return
                     "<?xml version='1.0' encoding='ISO-8859-1'?>" + newline
                   + "<xsl:stylesheet" + newline
                   + "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" + newline
                   + "version='1.0'>" + newline
                   + "<xsl:output method='xml'/>" + newline
                   + "<xsl:template match='/'>" + newline
                   + "<DontCareAboutContent></DontCareAboutContent>" + newline
                   + "</xsl:template>" + newline
                   + "</xsl:stylesheet>" + newline;
         private static String getStylesheet2() {
              return
                     "<?xml version='1.0' encoding='ISO-8859-1'?>" + newline
                   + "<xsl:stylesheet" + newline
                   + "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" + newline
                   + "version='1.0'>" + newline
                   + "<xsl:output method='html'/>" + newline
                   + "<xsl:template match='/'>" + newline
                  + "<html><body>" + newline
                 + "<xsl:message>" + newline
                 + "Error Message for the xslt processor" + newline
                 + "</xsl:message>" + newline
                 + "Dont care about the xslt content," + newline
                 + "The only significant part is the xsl:message element" + newline
                 + "which results in a error to be handled by the xslt" + newline
                 + "processor" + newline
                   + "</body></html>" + newline
                   + "</xsl:template>" + newline
                   + "</xsl:stylesheet>" + newline;
         private static String getExample() {
              return
                     "<?xml version='1.0' encoding='ISO-8859-1'?>" + newline
                   + "<DontCareAboutContent>" + newline
                   + "</DontCareAboutContent>" + newline;
    }

    I made the following change which solves the problem but the sollution is tightly coupled to Xalan. If anyone has any ideas, I would still like to find a way to achieve the desired result using JAXP API's.
                   XMLFilter filter1 = stf.newXMLFilter(new StreamSource(new StringReader(getStylesheet1())));
                   if (filter1 instanceof org.apache.xalan.transformer.TrAXFilter) {
                        ((org.apache.xalan.transformer.TrAXFilter)filter1).getTransformer().setErrorListener(...);
    ...

  • Network disconnects when using youtube on ipad air

    network disconnects and turns it self off when using youtube app on ipad air

    Hello paulm250m
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    Wi-Fi disconnects or signal strength is less than expected
    Move closer to the Wi-Fi router (access point).
    Check for sources of potential interference.
    Remove any case, stand, or other accessories from your iOS device and see if signal strength improves.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    Best of luck,
    Mario

  • How to find client disconnected when client lost net connection?

    Hi,
         Can anyone help how can I find on fms server that client disconnected if if client disconnected due to power cut off. I client manually close the application then onDisconnect on server is called but if due to power cut off it does not called.
    Thanks

    See if this article is any kind of help : http://www.flashcomguru.com/forum/forum_posts.asp?TID=2848

  • RMI detect client disconnect

    Hello, I want to detect when a network disconnect occurs. I implemented a TimerTask that checks every X seconds if the remote object is still bound in the registry, by doing a Naming.lookup(). When I unplug the cable of my computer (to simulate the disconnect), the Naming.lookup() just seems to hang, there is no response... When I plug in the cable again, then I get a response, but this is not the idea... Is there a way to set a timeout or something on this method call?
    thanks

    When I was toying around with chat servers using the RMI Technology, I would have the server keep a vector of RMI Clients (almost like the registry). Then when I went to send a message, I would try to cast the Vector element into the correct type of a client and write the message. If an exception was thrown, I knew the client was not connected any longer and I removed the client from the vector. This approach I have since seen in a lot of documentation on chat servers.
    I haven't tried this but you may try calling the Naming.list () and comparing the values to see if you find a match.
    Hope this helps

  • Detecting Client Disconnect

    I am looking for a way to determine when a client connects and disconnects (especially the latter) from the grid. Two approaches come to mind:
    1) Polling for something that appears/disappears when a client connects or disconnects. The most obvious candidate is a lock. This approach is inefficient because it requires polling. It also raises the issue of how clients are distinguished, although that is not difficult (e.g. - invocable increments a counter which is used as a basis for the key to lock).
    2) Getting a notification when this happens - preferably in-grid. However, I could find no listener for either the client connect/disconnect event or for locking. Likewise, using custom cache implementations (overriding a class and calling it out in the cache config) doesn't seem to provide notification of either locking, or (an alternate approach) the registration of a listener.
    Overriding a cache indeed provides notice of listener registration, but it appear to be a general listener which is feeding some other internal Coherence facility which manages the specific per-client listeners.

    Answering my own question, after research and help from Gene Glyzer:
    There are a couple of ways to do this:
    1) A client can lock a phantom (or real) entry in a cache. When the client member of the cluster goes away, the lock will be released.
    2) Tracking cluster members:
    * Add a listener:*service = CacheFactory.getService("name").addMemberListener(...)*
    * Get the membership information (synchronously guard against listener events):*Set members = service.getServiceMembers()*
    * Use subsequent listener events to adjust the members set.

  • Server to detect client disconnection "Sockets"

    i want to know how it is possible for a server to find out when the client is disconnected at any instance. not only at the time of sending data...
    i am writing a server that should communicate with different clients, and i want it to be able to find out if a client suddenly disconnects or crashes, so how can this be done?!
    is it this way:
    skt.setKeepAlive(true);the problem is that SO_KEEPALIVE checks after 2 hours, which is too much time, how can i change this value????

    So, i want to be able to find out if the client is disconnected without waiting to send or receive data.Use a read timeout.
    how can i change the value of SO_KEEPALIVEYou can't. It is two hours by default and requires privilege to change it, and changing it is system-wide. So you don't want to do that.
    Use a read timeout. Socket.setSoTimeout().

  • T440p: internet disconnects when using BT mouse

    I have the 2x2 Thinkpad wireless card and when I use my bluetooth mouse the internet disconnects and I get a "limited connection". I have the latest drivers for everything.

    Hi iphetamine and Jakoob,
    Remember that this is users helping users here, moderated by volunteers like me. Although there is some Lenovo presence, they can't patrol the entire community. They do try to help with some of the broader issues.
    Any possibility you're in a marginal WiFi reception area, and Bluetooth interferes with it?
    I don't work for Lenovo. I'm a crazy volunteer!

Maybe you are looking for

  • ISE authetication falied for NAD

    Hi, please can you advise for this kind of error ? Event 5400 Authentication failed Failure Reason 11014 RADIUS packet contains invalid attribute(s) Resolution Check the network device or AAA Client for hardware problems. Also check the network that

  • Replace with CSS?

    Hi all, I have some text with HTML markup saved in a DB that I'd like to output. The saved text includes some <p> tags, but when outputting, I'd like to apply a style, so I used #replaceNoCase(MessageBody,"<p>","<p class="Copy">","all")#, but I get a

  • Clearfix question

    So i am using a clear fix, but it is adding unwanted space between two divs. Is there a way to remove the space? and keep the clear fix. html <body>         <!-- Pushy Menu -->         <nav class="pushy pushy-left">             <ul>                 <

  • Unable to create SAPUI5 project on NWDS 7.31 SP10

    Hello Experts, I want to use SAPUI5 NWDS Plugin for my NWDS installation. NWDS version is 7.31 SP10 (Java is sapjvm_6). SAPUI5 Plugin file is UI5TOOL07_0-10011992.zip. The plugin was installed successfully but when I try to create project I get stuck

  • UCCE Remote Redundancy

    Hi I'm looking for information on how to setup remote redundancy on an UCCE 8.0. Side A and Side B are to be separated by a WAN link. Any information, documentos and help appreciated. Thanks Rhobab.