getMsgBuf() private method

private getMsgBuf ( ) : OtpInputStream
return OtpInputStream
Beispiel #1
0
        /*
         * Receive a raw (still encoded) message from a remote process. This
         * message blocks at most for the specified time until a valid
         * message is received or an exception is raised.
         *
         * <p> If the remote node sends a message that cannot be decoded
         * properly, the connection is closed and the method throws an
         * exception.
         *
         * @param timeout the time in milliseconds that this operation will
         * block. Specify 0 to poll the queue.
         *
         * @return an object containing a raw (still encoded) Erlang term.
         *
         * @exception C#.io.IOException if the connection is not active or
         * a communication error occurs.
         *
         * @exception Erlang.Exit if an exit signal is received from a
         * process on the peer node, or if the connection is lost for any
         * reason.
         *
         * @exception OtpAuthException if the remote node
         * sends a message containing an invalid cookie.
         *
         * @exception InterruptedException if no message if the method
         * times out before a message becomes available.
         **/
        public virtual OtpInputStream receiveBuf(long timeout)
        {
            OtpMsg str = receiveMsg(timeout);

            return(str != null?str.getMsgBuf() : null);
        }
Beispiel #2
0
        /*
         * Wait for a message to arrive for this mailbox.
         *
         * @param timeout the time, in milliseconds, to wait for a message
         * before returning null.
         *
         * @return a byte array representing the still-encoded body of the
         * next message waiting in this mailbox.
         *
         * @exception Exit if a linked {@link Pid pid} has
         * exited or has sent an exit signal to this mailbox.
         *
         * @exception InterruptedException if no message if the method
         * times out before a message becomes available.
         **/
        public virtual OtpInputStream receiveBuf(long timeout)
        {
            OtpMsg m = receiveMsg();

            return(m == null ? null : m.getMsgBuf());
        }