Erlang.NET.OtpErlangTuple.elementAt C# (CSharp) Метод

elementAt() публичный Метод

public elementAt ( int i ) : OtpErlangObject
i int
Результат OtpErlangObject
        public OtpErlangObject elementAt(int i)
        {
            if (i >= arity() || i < 0)
            {
                return null;
            }
            return elems[i];
        }

Usage Example

Пример #1
0
        /*
         * this method simulates net_kernel only for the purpose of replying to
         * pings.
         */
        private bool netKernel(OtpMsg m)
        {
            OtpMbox mbox = null;

            try
            {
                OtpErlangTuple t   = (OtpErlangTuple)m.getMsg();
                OtpErlangTuple req = (OtpErlangTuple)t.elementAt(1); // actual
                // request

                OtpErlangPid pid = (OtpErlangPid)req.elementAt(0); // originating
                // pid

                OtpErlangObject[] pong = new OtpErlangObject[2];
                pong[0] = req.elementAt(1); // his #Ref
                pong[1] = new OtpErlangAtom("yes");

                mbox = createMbox(true);
                mbox.send(pid, new OtpErlangTuple(pong));
                return(true);
            }
            catch (Exception)
            {
            }
            finally
            {
                closeMbox(mbox);
            }
            return(false);
        }
All Usage Examples Of Erlang.NET.OtpErlangTuple::elementAt