private void stateStream(MyStream st) { if (((uint)st.State == 0) || ((uint)st.State == 6)) { if ((int)st.State == 6) { st.Close(); } try { st.Open(st.con); } catch (COMException exception) { this.parent.logService("Ошибка в потоке " + st.StreamName + ". Ошибка: " + exception.Message); } } }
public DataBuffer(MyStream parent, string streamName,string connStr) { this.parent = parent; this.streamName = streamName; this.connStr = connStr; this.buffer = new ArrayList(); //this.thread = new Thread(new ThreadStart(this.Queue)); this.pgCon = new Npgsql.NpgsqlConnection(this.connStr); }