public uint SendMessage(Message_t msgCode, byte[] data = null, uint reqID = 0) { Message msg; lock (m_lock) msg = new Message(++m_clientLastMsgID, reqID, msgCode, data); try { string dest = SettingsManager.GetClientDialogURL(m_clInfo.ClientID); string src = SettingsManager.GetClientDialogFilePath(m_clInfo.ClientID); DialogEngin.AppendHubDialog(src, m_clInfo.ClientID, msg); new NetEngin(Program.NetworkSettings).Upload(dest, src); return(msg.ID); } catch (Exception ex) { Dbg.Log(ex.Message); } return(0); }
public void PostMessage(Message_t msgCode, byte[] data = null, uint reqID = 0) { lock (m_lock) { Message msg = new Message(++m_clientLastMsgID, reqID, msgCode, data); DialogEngin.AppendHubDialog(SettingsManager.GetClientDialogFilePath(m_clInfo.ClientID), m_clInfo.ClientID, msg); m_needUpload = true; } }
void PostCloseMessage() { Dbg.Log("Posting closing notification..."); var req = new Message(++m_clientLastMsgID, 0, Message_t.Close); string dlgFile = SettingsManager.GetClientDialogFilePath(m_clInfo.ClientID); DialogEngin.AppendHubDialog(dlgFile, m_clInfo.ClientID, req); try { new NetEngin(Program.NetworkSettings).Upload(SettingsManager.GetClientDialogURL(m_clInfo.ClientID), dlgFile); } catch (Exception ex) { Dbg.Log("PostCloseMessage: " + ex.Message); } }