Citrix remote disconnect / Remote disconnect source - citrix

Consider xen app server hosting published application. Is it possible to find out if the remote disconnect was triggered by citrix or other source ?

if it was disconnect by Citrix then it normally because of the idle timeout and if this is the case then there will be a event in the windows event stating that the session was disconnected because of idle timeout

Related

WCF hosted in Windows service close all connections after some time

we are facing an issue with WCF service hosted in a Windows service with net.tcp binding.
After some time it closes all connection (we see it in real time with TCPView). We noticed this behavior because in the client application log we find errors of TCP connection refused 10061. When all connection are close it starts to accept new conections. All firewall and antivirus has been disabled. RAM and CPU are ok.
What can I look for?
Thanks

Strophe connection did not restore connection after some time

I am using strophe.js to intract with xmpp . it has the feature to restore its states when network fluctuate. this work okay for short time but when network got connected after 5 to 10 min fater disconnection it didnt restore its connection. any ideas why this it is so?
You can use connection manager for this. see this one
Basically what you to do is that start a timer when network get disconnected and in that timer check network connection. once network found connected relogin the strophe to make it working.

server can't close socket connection with iPhone when iPhone is in standby mode

I use AsyncSocket to establish tcp connection via Wifi to a server, and after 10 seconds, the server will actively close the connection.
When the iPhone is not in standby mode, the connection will be destroyed immediately after the server call ::close(int socked).
But when the iPhone is in standby mode, I find the connection is still alive when the server has called the ::close(int socketfd) API.
Can anyone give an explanation?
The Problem is that your server send the close question and wait for a answer of the client that it even will close the connection. Your IPhone is in Standby and can't send any question or answers, if the connection is dead it should be auto close, maybe you have to implement a connection dead function for this case.

Does an application running via Citrix listen on local interfaces?

Let's say you have an application that listens on a socket on all network interfaces on a machine and displays the messages it receives on a UI. If I run this application on a client machine via Citrix (Presentation Server?) would the application also be listening on the network interfaces available on the client machine by default. If not is there a way to make that work?
If you run the application via Citrix, it is executed on the Citrix (XenApp / Presentation) Server and listens on the server.
If you would rather have the application listen on the client but be executed on the server, you could use the virtual channel SDK to pass data between the server and the client. You can find more information in an earlier answer.

Is there a way to wait for a listening socket on win32?

I have a server and client program on the same machine. The server is part of an application- it can start and stop arbitrarily. When the server is up, I want the client to connect to the server's listening socket. There are win32 functions to wait on file system changes (ReadDirectoryChangesW) and registry changes (RegNotifyChangeKeyValue)- is there anything similar for network changes? I'd rather not have the client constantly polling.
There is no such Win32 API, however this can be easily accomplished by using an event. The client would wait on that event to be signaled. The server would signal the event when it starts up.
The related API that you will need to use is CreateEvent, OpenEvent, SetEvent, ResetEvent and WaitForSingleObject.
If your server will run as a service, then for Vista and up it will run in session 0 isolation. That means you will need to use an event with a name prefixed with "Global\".
You probably do have a good reason for needing this, but before you implement this please consider:
Is there some reason you need a connect right away? I see this as a non issue because if you perform an action in the client, you can at that point make a new server connection.
Is the server starting and stopping more frequently than the client? You could switch roles of who listens/connects
Consider using some form of Windows synchronization, such as semaphore. The client can wait on the synchronization primitive and the server can signal it when it starts up.
Personally I'd use a UDP broadcast from the server and have the "client" listening for it. The server could broadcast a UDP packet every X period whilst running and when the client gets one, if it's not already connected, it could connect.
This has the advantage that you can move the client onto a different machine without any issues (and since the main connection from client to server is sockets already it would be a pity to tie the client and server to the same machine simply because you selected a local IPC method for the initial bootstrap).