Esempio n. 1
0
        // used by the other message types
        protected void DoSend(OtpOutputStream header)
        {
            lock (objWrite)
            {
                try
                {
                    if (TraceLevel >= TraceCTRL)
                    {
                        try
                        {
                            IOtpErlangObject h = header.Slice(5).ReadAny();
                            Logger.Debug("-> " + HeaderType(h) + " " + h);
                        }
                        catch (OtpDecodeException e)
                        {
                            Logger.Debug("   " + "can't decode output buffer: " + e);
                        }
                    }

                    header.WriteTo(socket.OutputStream);
                }
                catch (IOException)
                {
                    Close();
                    throw;
                }
            }
        }
Esempio n. 2
0
        // used by send and send_reg (message types with payload)
        protected void DoSend(OtpOutputStream header, OtpOutputStream payload)
        {
            lock (objWrite)
            {
                try
                {
                    if (TraceLevel >= TraceSend)
                    {
                        // Need to decode header and output buffer to show trace
                        // message!
                        // First make OtpInputStream, then decode.
                        try
                        {
                            IOtpErlangObject h = header.Slice(5).ReadAny();
                            Logger.Debug("-> " + HeaderType(h) + " " + h);

                            IOtpErlangObject o = payload.Slice(0).ReadAny();
                            Logger.Debug("   " + o);
                        }
                        catch (OtpDecodeException e)
                        {
                            Logger.Debug("   " + "can't decode output buffer:" + e);
                        }
                    }

                    header.WriteTo(socket.OutputStream);
                    payload.WriteTo(socket.OutputStream);
                }
                catch (IOException)
                {
                    Close();
                    throw;
                }
            }
        }