disconnect

When PostgreSQL stops TFDConnection.Connected remains True

半腔热情 提交于 2019-12-07 19:40:08
问题 I am connecting to PostgreSQL 9.5 x64 using Delphi 10 and FireDAC. There is a reconnect feature in my software which relies on TFDConnection.Connected flag: if not _conn.Connected then if _autoConnect then _conn.Connected := True else raise Exception.Create('Not connected to database'); After I connect my software to PostgreSQL and start executing queries, I go to Windows services control panel and stop-start PostgreSQL server in order to test the reconnect feature. After starting PostgreSQL

PHP - kill exec on client disconnect

为君一笑 提交于 2019-12-07 08:46:03
问题 I have very primitive web front-end for my C++ application. Client (web browser) is enters php site and fills form with parameters. Than (after post submit) php calls exec and application does its work. Application can work longer than minute and requires pretty large amount of RAM. Is there any possibility to detect disconnecting from client (for example closure of tab in web browser). I want to do this, because after disconnecting client will not be able to see result of computations, so I

How to disconnect an HttpUrlConnection on HTC (Froyo and below) phones?

一个人想着一个人 提交于 2019-12-07 05:28:20
问题 I need to disconnect a long polling http request from the client side in some cases. The relevant part of the HttpUrlConnection I make to the server is as follows (all the code below is within a Thread's run() method): try { URL url = new URL(requestURL); connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("Accept-Charset", "UTF-8"); connection.setConnectTimeout(5 * 1000); connection.setReadTimeout(60 * 1000); connection.setRequestMethod("GET"); // read the

When PostgreSQL stops TFDConnection.Connected remains True

我只是一个虾纸丫 提交于 2019-12-06 01:59:40
I am connecting to PostgreSQL 9.5 x64 using Delphi 10 and FireDAC. There is a reconnect feature in my software which relies on TFDConnection.Connected flag: if not _conn.Connected then if _autoConnect then _conn.Connected := True else raise Exception.Create('Not connected to database'); After I connect my software to PostgreSQL and start executing queries, I go to Windows services control panel and stop-start PostgreSQL server in order to test the reconnect feature. After starting PostgreSQL server I continue to get following errors: [FireDAC][Phys][PG][libpq] no connection to the server and

Do TCP sockets automatically close after some time if no data is sent?

眉间皱痕 提交于 2019-12-05 20:39:35
问题 I have a client server situation where the client opens a TCP socket to the server, and sometimes long periods of time will pass with no data being sent between them. I have encountered an issue where the server tries to send data to the client, and it seems to be successful, but the client never receives it, and after a few minutes, it looks like the client then gets disconnected. Do I need to send some kind of keep alive packet every once in a while? Edit : To note, this is with peers on

PHP - kill exec on client disconnect

三世轮回 提交于 2019-12-05 16:03:06
I have very primitive web front-end for my C++ application. Client (web browser) is enters php site and fills form with parameters. Than (after post submit) php calls exec and application does its work. Application can work longer than minute and requires pretty large amount of RAM. Is there any possibility to detect disconnecting from client (for example closure of tab in web browser). I want to do this, because after disconnecting client will not be able to see result of computations, so I can kill application and free some RAM on server. Thanks for any help or suggestions. DaveRandom As

HTTP disconnect/timeout between request and response handling

别说谁变了你拦得住时间么 提交于 2019-12-05 14:38:15
问题 Assume following scenario: Client is sending HTTP POST to server Request is valid and have been processed by server. Data has been inserted into database. Web application is responding to client Client meets timeout and does not see HTTP response. In this case we meet situation where: - client does not know if his data was valid and been inserted properly - web server (rails 3.2 application) does not show any exception, no matter if it is behind apache proxy or not I can't find how to handle

Best practice to detect a client disconnection in .NET?

大兔子大兔子 提交于 2019-12-04 21:39:35
问题 I'm developing a server in C# which can accept only one client and I need to know when this client is disconnected to be able to accept another connection requests. I'm using a first Socket which continuously listen to connection request with Socket.BeginAccept and accept or reject clients. When a client is accepted, the new Socket which is returned by Socket.EndAccept is used for the communication between client and server. Then, the server waits for commands from the client with Socket

Using Android API23 Call and Call.Details Class to get Disconnect Cause for Calls

故事扮演 提交于 2019-12-04 17:23:50
All i am trying to do is to get the reason why a call was disconnected. I have searched but i am unable to find any solution for API level under 23. but in API 23 we have; https://developer.android.com/reference/android/telecom/Call.html https://developer.android.com/reference/android/telecom/Call.Details.html Call.Details.getDisconnectCause() returns the Disconnect Cause object but i am unable to understand how i can use use the CALL class or DETAILS class or which broadcasts to use to get these objects(if any). So is there a broadcast i have to handle that returns call states in extras? or

Do TCP sockets automatically close after some time if no data is sent?

一个人想着一个人 提交于 2019-12-04 04:09:25
I have a client server situation where the client opens a TCP socket to the server, and sometimes long periods of time will pass with no data being sent between them. I have encountered an issue where the server tries to send data to the client, and it seems to be successful, but the client never receives it, and after a few minutes, it looks like the client then gets disconnected. Do I need to send some kind of keep alive packet every once in a while? Edit : To note, this is with peers on the same computer. The computer is behind a NAT, that forwards a range of ports used to this computer.