Beispiel #1
0
        private int Invoke(TypedObject packet)
        {
            lock (isInvokingLock)
            {
                int id = NextInvokeID();
                pendingInvokes.Add(id);
                //AHANDA BURDA MEMORY LEAK
                //Console.Out.Write("Added pending invoke");
                try
                {
                    RTMPSEncoder encoder = new RTMPSEncoder();
                    byte[] data = encoder.EncodeInvoke(id, packet);

                    sslStream.Write(data, 0, data.Length);

                    return id;
                }
                catch (IOException e)
                {
                    // Clear the pending invoke
                    pendingInvokes.Remove(id);

                    // Rethrow
                    throw e;
                }
            }
        }
        private int Invoke(TypedObject packet)
        {
            lock (isInvokingLock)
            {
                int id = NextInvokeID();
                pendingInvokes.Add(id);

                try
                {
                    RTMPSEncoder encoder = new RTMPSEncoder();
                    byte[]       data    = encoder.EncodeInvoke(id, packet);

                    sslStream.Write(data, 0, data.Length);

                    return(id);
                }
                catch (IOException e)
                {
                    // Clear the pending invoke
                    pendingInvokes.Remove(id);

                    // Rethrow
                    //throw e;
                    return(0);
                }
            }
        }
Beispiel #3
0
        private int Invoke(TypedObject packet)
        {
            lock (isInvokingLock)
            {
                int id = NextInvokeID();
                pendingInvokes.Add(id);

                try
                {
                    RTMPSEncoder encoder = new RTMPSEncoder();
                    byte[] data = encoder.EncodeInvoke(id, packet);

                    sslStream.Write(data, 0, data.Length);

                    return id;
                }
                catch (IOException e)
                {
                    // Clear the pending invoke
                    pendingInvokes.Remove(id);

                    // Rethrow
                    throw e;
                }
            }
        }