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); }
private void sendFuncMsg(FuncMsgClient.FuncType type, List <object> args) { lock (_monitorLock) { waitMyTurn(); sendMsg(type, args); waitResponse(); finishMyTurn(); return; } }
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); } }