private void ASyncDataRecive(IAsyncResult asynResult) { try { UserSession css = (UserSession)asynResult.AsyncState; if (css.AsynSocket == null) { return; } int i = css.AsynSocket.EndReceive(asynResult); if (i == 0) { return; } string Unzipdata = UZip.Unzip(System.Text.ASCIIEncoding.ASCII.GetString(css.AsyncBuffer, 0, i)); css.AsyncData.Append(Unzipdata); if (!css.AsyncData.ToString().Contains("\0")) { css.AsynSocket.BeginReceive(css.AsyncBuffer, 0, UserSession.BufferSize, SocketFlags.None, new AsyncCallback(ASyncDataRecive), css); } else { css.AsyncData = FilterData(css); css.AsynSocket.BeginReceive(css.AsyncBuffer, 0, UserSession.BufferSize, SocketFlags.None, new AsyncCallback(ASyncDataRecive), css); } } catch (Exception ex) { OnServerDownError(ex); } }
private DataSet SyncDataRecive() { try { userSession.SyncData = new StringBuilder(); int i = userSession.SynSocket.Receive(userSession.SyncBuffer); while (true) { string Unzipdata = UZip.Unzip(System.Text.ASCIIEncoding.ASCII.GetString(userSession.SyncBuffer, 0, i)); userSession.SyncData.Append(Unzipdata); if (!userSession.SyncData.ToString().Contains("\0")) { i = userSession.SynSocket.Receive(userSession.SyncBuffer); } else { break; } } if (UData.IsValidXml(userSession.SyncData.ToString())) { return(UData.LoadDataSet(userSession.SyncData.ToString())); } else { DataSet ds = new DataSet(); return(ds); } } catch (Exception ex) { OnServerDownError(ex); return(new DataSet()); } }
public static DataSet UnzipDataSet(string xsd, string ds) { return(UData.LoadDataSet(xsd, UZip.Unzip(ds))); }
public static DataTable UnzipDataTable(string xsd, string dt) { return(UData.LoadDataTable(xsd, UZip.Unzip(dt))); }
public void LoadXml(string dt) { UData.LoadDataTable(this.DataTable, UZip.Unzip(dt)); }