I have a C # application that runs as a windows service. This application uses a tiny open source HTTP server to communicate by URL. There is a flext application designed to update and select data from a sqlite database using a C # application using get / post methods.
I have a url https: / domainname: portnumber / folder / tree / 200 that reads data from a database using a C # service and returns a huge amount of data in xml form to the client.
In some cases, when this url gets called by totral C #, the windows service restarts. And then you need to update the flext application to start it again. The firewall of the server on which the Windows service is installed is disabled, and the machine is also available.
When I checked the log I found after this URL call, the server will reboot. Also, when I checked the traffic in the violinist, I received the error below:
HTTP/1.1 502 Fiddler - Connection Failed Content-Type: text/html; charset=UTF-8 Connection: close Timestamp: 10:18:52.685 [Fiddler] The socket connection to (domainname) failed. <br />ErrorCode: 10061.
The code used to call this folder / tree is below
public string Tree() { try { string langstr = ""; if (Request.QueryString["lang"] != null && !string.IsNullOrEmpty(Request.QueryString["lang"].Value)) { langstr = Request.QueryString["lang"].Value.ToString(); } else { ThingzDatabase db = SessionDatabase; langstr = db.DefaultLanguage; db = null; } folderTree = new FolderTree(Convert.ToInt32(Id), true, SessionDatabase, langstr); XmlDocument doc = folderTree.XML; Response.ContentType = ContentType.Xml; langstr = null; folderTree.db2 = null; folderTree = null;
The following code is used to execute a query from the sqlite database
public SQLiteDataReader ExecuteSQL(String sqlExpr) { if (conn.State != ConnectionState.Open Open(DataFile); using (SQLiteCommand cmd = conn.CreateCommand()) { cmd.CommandText = sqlExpr + ";PRAGMA read_uncommitted = 1;"; cmd.CommandType = CommandType.Text; return cmd.ExecuteReader(); } }
source share