示例#1
0
 public static TcpSocketImpl getInstance()
 {
     if (instance == null)
     {
         instance = new TcpSocketImpl();
     }
     return(instance);
 }
示例#2
0
文件: ProxyObj.cs 项目: zglbig/eib-c
        public static void CreateTcpProxy(Type obj, string methodName, List <string> args, short gameId)
        {
            //var clazzType = (Proxy)Attribute.GetCustomAttribute(obj, typeof(Proxy));
            //if (clazzType == null)
            //{
            //    throw new NullReferenceException("");
            //}
            //   short gameId = clazzType.gameId;
            ClientTcpIoMessage client = new ClientTcpIoMessage();

            client.interfaceName = obj.FullName;
            client.methodName    = methodName;
            // client.args = JsonConvert.SerializeObject(callMessage.Args);
            if (args != null)
            {
                client.args = JsonMapper.ToJson(args);
            }
            else
            {
                client.args = null;
            }
            TcpSocketImpl.getInstance().async(client, gameId, -10);
        }