Example #1
0
        public ER udp_snd_dat(ID cepid, T_IPV4EP p_dstaddr, pointer data, int len, TMO tmout)
        {
            ER Result = ER.E_NOEXS;
            UdpCep UdpCep;

            if ((data == null) || (len <= 0))
                return ER.E_PAR;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                UdpCep = g_Kernel.Nucleus.GetUdpCep(cepid);
                if (UdpCep == null)
                    Result = ER.E_NOEXS;
                else
                    Result = UdpCep.SendData(p_dstaddr, data, len, tmout);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return Result;
        }
Example #2
0
        public ER tcp_con_cep(ID cepid, T_IPV4EP p_myaddr, T_IPV4EP p_dstaddr, TMO tmout)
        {
            ER Result = ER.E_NOEXS;
            TcpCep TcpCep;

            if (p_dstaddr == null)
                return ER.E_PAR;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                TcpCep = g_Kernel.Nucleus.GetTcpCep(cepid);
                if (TcpCep == null)
                    Result = ER.E_NOEXS;
                else
                    Result = TcpCep.Connect(p_myaddr, p_dstaddr, tmout);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return Result;
        }