Exemple #1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <System.Net.Sockets.Socket>(L, 4) && translator.Assignable <System.Net.IPEndPoint>(L, 5) && translator.Assignable <DCET.Model.KService>(L, 6))
                {
                    uint _localConn  = LuaAPI.xlua_touint(L, 2);
                    uint _remoteConn = LuaAPI.xlua_touint(L, 3);
                    System.Net.Sockets.Socket _socket         = (System.Net.Sockets.Socket)translator.GetObject(L, 4, typeof(System.Net.Sockets.Socket));
                    System.Net.IPEndPoint     _remoteEndPoint = (System.Net.IPEndPoint)translator.GetObject(L, 5, typeof(System.Net.IPEndPoint));
                    DCET.Model.KService       _kService       = (DCET.Model.KService)translator.GetObject(L, 6, typeof(DCET.Model.KService));

                    DCET.Model.KChannel gen_ret = new DCET.Model.KChannel(_localConn, _remoteConn, _socket, _remoteEndPoint, _kService);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <System.Net.Sockets.Socket>(L, 3) && translator.Assignable <System.Net.IPEndPoint>(L, 4) && translator.Assignable <DCET.Model.KService>(L, 5))
                {
                    uint _localConn = LuaAPI.xlua_touint(L, 2);
                    System.Net.Sockets.Socket _socket         = (System.Net.Sockets.Socket)translator.GetObject(L, 3, typeof(System.Net.Sockets.Socket));
                    System.Net.IPEndPoint     _remoteEndPoint = (System.Net.IPEndPoint)translator.GetObject(L, 4, typeof(System.Net.IPEndPoint));
                    DCET.Model.KService       _kService       = (DCET.Model.KService)translator.GetObject(L, 5, typeof(DCET.Model.KService));

                    DCET.Model.KChannel gen_ret = new DCET.Model.KChannel(_localConn, _socket, _remoteEndPoint, _kService);
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to DCET.Model.KChannel constructor!"));
        }
Exemple #2
0
        static int _m_HandleRecv(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);



                {
                    byte[] _date   = LuaAPI.lua_tobytes(L, 2);
                    int    _offset = LuaAPI.xlua_tointeger(L, 3);
                    int    _length = LuaAPI.xlua_tointeger(L, 4);

                    gen_to_be_invoked.HandleRecv(_date, _offset, _length);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #3
0
        static int _s_set_LocalConn(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.LocalConn = LuaAPI.xlua_touint(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Exemple #4
0
        static int _g_get_Stream(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.Stream);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Exemple #5
0
        static int _m_Dispose(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Dispose(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #6
0
        static int _m_Send(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);



                {
                    System.IO.MemoryStream _stream = (System.IO.MemoryStream)translator.GetObject(L, 2, typeof(System.IO.MemoryStream));

                    gen_to_be_invoked.Send(_stream);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #7
0
        static int _m_GetKChannel(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.KService gen_to_be_invoked = (DCET.Model.KService)translator.FastGetCSObj(L, 1);



                {
                    long _id = LuaAPI.lua_toint64(L, 2);

                    DCET.Model.KChannel gen_ret = gen_to_be_invoked.GetKChannel(_id);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #8
0
        static int _m_Output(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.KChannel gen_to_be_invoked = (DCET.Model.KChannel)translator.FastGetCSObj(L, 1);



                {
                    System.IntPtr _bytes = LuaAPI.lua_touserdata(L, 2);
                    int           _count = LuaAPI.xlua_tointeger(L, 3);

                    gen_to_be_invoked.Output(_bytes, _count);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }