Ejemplo n.º 1
0
        private void sendMsg(FuncMsgClient.FuncType type, List <object> args)
        {
            FuncMsgClient msg = new FuncMsgClient();

            msg.type = type;
            msg.args = args;
            BinaryFormatter bformatter = new BinaryFormatter();

            bformatter.Serialize(_server.GetStream(), msg);
        }
Ejemplo n.º 2
0
        private void sendFuncMsg(FuncMsgClient.FuncType type, List <object> args)
        {
            lock (_monitorLock)
            {
                waitMyTurn();
                sendMsg(type, args);
                waitResponse();

                finishMyTurn();
                return;
            }
        }
Ejemplo n.º 3
0
        private T sendFuncMsg <T>(FuncMsgClient.FuncType type, List <object> args)
        {
            lock (_monitorLock)
            {
                waitMyTurn();
                sendMsg(type, args);
                waitResponse();
                if (!argCheck <T>(_response.args, 0) || _response.type == FuncMsgServer.FuncType.ErrorReplay)
                {
                    throw new BadResponseException();
                }


                T arg = getArgument <T>(_response.args, 0);

                finishMyTurn();
                return(arg);
            }
        }