/// <summary> /// call write-method of more than one server /// </summary> /// <param name="ocbNum"></param> /// <param name="value">array of values</param> /// <param name="lasalid">array of lasalid</param> /// <param name="no">number of lasalids</param> /// <returns></returns> public static bool CallWriteMethodOfServerListH(int ocbNum, uint[] lasalid, uint[] value, uint no) { if ((lasalid != null) && (value != null) && (no > 0) && (no <= 30)) { I_WR_SVRLIST_Stream tx = new I_WR_SVRLIST_Stream(lasalid, value, no); IRESULT_Stream rx = new IRESULT_Stream(); if (ExecIprH(ocbNum, tx.GetData(), rx.GetData(), rx.GetSize()) == true) { return true; } } return false; }
/// <summary> /// call read-method of more than one server /// </summary> /// <param name="ocbNum"></param> /// <param name="value">array of values</param> /// <param name="lasalid">array of lasalid</param> /// <param name="no">number of lasalids</param> /// <returns></returns> public static bool CallReadMethodOfServerListH(int ocbNum, out uint[] value, uint[] lasalid, uint no) { if ((lasalid != null) && (no > 0) && (no <= 60)) { I_RD_SVRLIST_Stream tx = new I_RD_SVRLIST_Stream(lasalid, no); IRESULT_Stream rx = new IRESULT_Stream(); if (ExecIprH(ocbNum, tx.GetData(), rx.GetData(), rx.GetSize()) == true) { uint tmp; if (rx.Read32(out tmp, 6) == true) { if (tmp == no) { value = new uint[no]; for (uint i = 0; i < no; i++) rx.Read32(out value[i], 10 + i * 4); return true; } } } } value = null; return false; }
/// <summary> /// write data to dataserver /// </summary> /// <param name="ocbNum"></param> /// <param name="value"></param> /// <param name="lasalid"></param> /// <param name="access_denied"></param> /// <returns></returns> public static bool CallWriteMethodOfServerH(int ocbNum, uint value, uint lasalid, out bool access_denied) { access_denied = false; if (lasalid != 0) { IWRITE_Stream tx = new IWRITE_Stream(lasalid, value); IRESULT_Stream rx = new IRESULT_Stream(); if (ExecIprH(ocbNum, tx.GetData(), rx.GetData(), rx.GetSize()) == true) { uint result; if (rx.IsValid() == true) { if (rx.Read32(out result, 6) == true) { if (result == ACCESS_DENIED) access_denied = true; return true; } } } } return false; }
/// <summary> /// read data from dataserver /// </summary> /// <param name="ocbNum"></param> /// <param name="value"></param> /// <param name="lasalid"></param> /// <returns></returns> public static bool CallReadMethodOfServerH(int ocbNum, out uint value, uint lasalid) { value = 0; if (lasalid != 0) { IREAD_Stream tx = new IREAD_Stream(lasalid); IRESULT_Stream rx = new IRESULT_Stream(); if (ExecIprH(ocbNum, tx.GetData(), rx.GetData(), rx.GetSize()) == true) { if (rx.IsValid() == true) { rx.Read32(out value, 6); return true; } } } return false; }