Stop Mirth Connect keepalive messages from SFTP File Reader connector - sftp

My Mirth Connect v3.4 channel's File Reader source connector is configured as the SFTP reader to poll files from a remote server every 20 minutes and it works as expected.
But when the channel goes idle it starts sending keepalive#jcraft.com messages to the remote server every 10 seconds regardless of the Timeout setting of that source connector.
Is there anything else to configure to stop these messages from being sent to keep connection alive or is there any workarounds other than restarting the channel after each poll by some other channel?

From the JSch changelog:
change: at TCP socket reading timeout, keep-alive message will be sent
to the remote sshd. To disable this functionality, invoke
explicitly Session.setServerAliveCountMax(0)
Unfortunately JSch does not provide any way to set this value from its own configuration file. So you'll have to use JavaScript and create a Session manually.

Related

IIS with secure socket connection keeps responding after stopping website

I'm running IIS 10.0 on Windows Server 2019 Standard a simple ASP.NET Framework 4.7.2 with long running Websocket connection and SignalR.
Things work well when it comes to stopping the website and sockets are closed if I'm using non secured sockets. However if I have a secure socket connection (TLS/SSL) the worker process will hang as long as the sockets are open. The client will continue to send and receive responses from the server. The only way to fix this is to have the client restart the connection.
Both direct websockets or via SignalR will cause this issue, the application will keep on running after trying to stop the website, transmitting and receiving messages over the secure socket; as soon as the socket closes the worker process dies as expected.
Here is a similar issue with no response : Server keeps sending ping messages to client after IIS site is stopped.
Connections do not timeout after the app pool timeout (90s)
Here is a screenshot of the active connections
What could be causing this and how do I make sure these connections are dropped when a stop/recycle is requested by IIS ?
Update:
If I change the port but still use a secure connection, the problem goes away. On website stop, the connections are dropped and the worker process dies as expected. So it seems to have something to do with port 443...

Keepalive SFTP connection in Control-M Advanced File Transfer

I have a requirement to send a 10 GB file to a client SFTP server through an automated process. We are using BMC Control-M to automate the whole process.
However, the client SFTP Server disconnects the session after 300 seconds due to inactivity. And since the file size is quite big, file transfer fails due to SFTP Server disconnect.
During testing, I was sending the file manually, through WinSCP. In WinSCP, we have an option called Keepalives, that will keep a FTP connection alive.
Is there any similar option we can set in Control-M AFT settings?
This can be changed by right clicking on the "Control-M for Advanced File Transfer" (or "Control-M for Managed File Transfer", depending on which version you have) in Control-M Configuration Manager (CCM).
From there, open "Configuration Management" then update "Connection timeout (seconds)" to your required value.

Can a Winsock TCP connection between server and client resume as-was after the server must restart?

Is there a way to save the "state" of Winsock so that the server program can be stopped and restarted and all the client TCP connections continue as though nothing happened, without the clients having to do anything special?
Or is it the case that once a Winsock server process terminates, client connections can only be reestablished through all the usual initialization calls?
A lost/closed connection must be re-established through a new connect handshake. So if you don't want the client to know the server is restarted, you will have to move the existing connection to another process first, then move it back after the restart. You can use WSADuplicateSocket() for that.

Server-Sent Events queries

We have a requirement wherein the server needs to push the data to various clients. So we went ahead with SSE (Server-Sent events). I went through the documentation but am still not clear with the concept. I have following queries :
Scenario 1. Suppose there are 10 clients. So all the 10 clients will send the initial request to server. 10 connections are established. When the data enters the server, a message is pushed from server to client.
Query 1 : Will the server maintain the IP address of all the client? If yes is there an API to check it?
Query 2: What will happen if all the 10 client windows are closed? Will the server abort all connections after a period of time?
Query 3: What will happen if the Server is unable to send messages to client due to unavailability of client like machine shutdown. Will the server abort all connections after a period of time for those client for whom they are unable to send the message?
Please clarify?
This depends on how you implement the server.
If using PHP, as an Apache module, then each SSE connection creates a new PHP instance running in memory. Each "server" is only serving one client at a time. Q1: yes, but not your problem: you just echo messages to stdout. Q2/Q3: If the client closes the connection, for any reason, the PHP process will shutdown when it detects this.
If you are using a multi-threaded server, e.g. using http in node.js. Q1: the client IP is part of the socket abstraction, and you just send messages to the response object. Q2/Q3: as each client connection closes the socket, the request process that was handling it will end. Once all 10 have closed your server will still be running, but not sending data to any clients.
One key idea to realize with SSE is that each client is a dedicated socket. It is not a broadcast protocol, where you push out one message and all clients get exactly the same message. Instead, you have to send the data to each client, individually. But that also means you are free to send customized data to each client.

Connection refused - not consistent

I have an application that is used to make hotel bookings. The application takes an XML message, transforms the XML into another XML message and sends this new XML to another application. I am able to book hotels successfully.
When I try to amend this booking (different XML request, same application, same URL) I get a 'Connection refused' error.
I would have thought that there'd be consistency (all work or none) but there's not.
Anyone any idea why?
"Connection refused" means that no application is accepting connections on the port and host that you try to connect to. It can be caused by
The application is actually running on a different host or a different port
The application crashed and hasn't been restarted
The application is buggy: it closes the listening server socket from time to time, so that it is not listening for connection attempts all the time
Firewall is configured to respond to new connections with a "connection refused" even if the application was able to accept a connection

Resources