Screenshot from an inactive to an RDP session - winapi

I need to do a screen capture using DirectShow from the RDP session, but the problem is that the seizure does not occur if the disconnect from the session. Is there any way to make a drawing of the session to continue even after you disconnect rdp session?

Related

What happens with WebSocket connections when a phone's screen locks?

When a phone browser has an open connection, and the user locks the screen, then at a certain point they will no longer have a WebSocket connection.
What events are fired when this happens? Is the WebSocket.onerror or WebSocket.onclose handler called, and if so, does this happen when the screen locks/the app is suspended, or when the app comes back up again?
(And bonus question: is this standardised, or do browsers behave differently, and if so, how?)
I've done some testing myself, and the answer seems to be: no events are fired. Although the connection does drop, no error or close events are fired, not even when the browser comes back up. Therefore, the main way to deal with this appears to be to periodically check the connection status, and reconnect if need be - with exponential back-off in case the connection drops server-side. (Or to have a library do this for you, though I haven't found a properly maintained client-side browser-based WebSocket library that does this yet.)
This seems corroborated by the author of this article:
Mobile devices introduce a new category of connection issues; if a mobile device is locked, goes to sleep or the application is moved to the background, an active WebSocket connection may become unresponsive and not close itself properly.

Notify server that client system shut down

I have a situation where I need to know that client system has shut down manually or due to power failure (irrespective of same LAN or wide network).
I need to know that after logging in to my application (web), client forget to logout and shut down his system manually or due to power failure.
I'm storing logged in users status in a HashMap not in DB and removing when clicking logout button....
If system got shut down without logging out that is not removing from the HashMap. Is there any event listener in Java to catch client shut down status?
How can I achieve this scenario, is this possible?
I'm using Vaadin 7.4.3 as a framework for my web application.
Add a session destroy listener to your web application and remove the user there. The session destroy listener will be called when session expires. Actually you should implement the logout button that way that it invalidates the session so the only place where you need to remove users is this session destroy listener.

Socket.IO : What is the recommended pattern for server side cleanup?

Is it enough to cleanup on disconnect? What happens if a browser disappears before sending an explicit disconnect?
What is the recommended pattern for server side cleanup, so that the resources bound to the connection are not leaked (e.g. Namespace)?
(using gevent-socketio, if it matters)
If you use WebSockets as transport, it would automaticaly disconnect the socket on browser close.
If you use xhr-polling for example it would not automaticaly disconnect (speaking about gevent-socketio).
My approach when xhr-polling is used was:
Saving the socket session id among with logged in user id in database
On next user login detect if such a record exists
Use the stored session id in the record to disconect the unused socket since the fresh user login would generate new socket
This is not rapid solution since you may have unused sockets connected until new login is performed by the user, but it performs a kind of cleanup when the user log in.
This article may be a hint to something more creative than mine solution: http://flask.pocoo.org/snippets/71/

Disconnecting a browser tab (testing what happens when the user connection breaks)

I'm looking for a way to force a connection break (a way to disconnect) a browser tab.
What I'm trying to do is to test my site, where I open a websocket to the server from the browser, and then emulate a disconnection, but just on that browser tab (or even just on the browser), because I need my connection to check what happens on the server in that precise instant.
I was looking for a chrome extension to do so, but I don't find any. But any way to accomplish that would be fine.
My client OS is MacOSX 10.5
In Chrome, use Menu | Tools | Task Manager to see a list of tabs. You can kill a tab in the middle of a page load from there.
You could just kill the browser process. In that case the browser wouldn't be able to close the connection gracefully. It would pretty much look like a severed network connection to the server.
See this question on superuser.com for how to kill a process on MacOS.
An even more realistic test would be to set up a virtual machine, run the client there (or the server), and then interrupt the virtual network connection.
Another option would be to set up a local proxy server (note that few proxy servers already support WebSockets), connect to the server through this proxy, and then simulate an interrupted connection by killing the proxy. That way you could observer both the servers and the clients reaction to the event.
In chrome now there's an "offline" option, under the Network tab from the DevTools, but if you are looking for a websocket disconnection, like myself, you must be aware of this:
https://bugs.chromium.org/p/chromium/issues/detail?id=423246

Is there any technology to kill the user login session if user close the browser?

This should work if multiple windows are open.
My application is in J2EE.
I already tried some javascript like on window.unloadn but this kind of solution is not solid.
If you mean on the server side, the best way is to implement a heartbeat. If none of the windows from this webapp are open, nothing sends a heartbeat, and a server after some time will know the app is disconnected.
If you mean on the client side, there's no 100% reliable way, since the browser might die from external causes (kill/crash/reboot), but a timed-out cookie that is updated regularly in a heartbeat-like fashion might work
HTTP is a stateless, meaning you can't tell when a browser is closed.
Your attempt to use window.onunload does not always work because the browser could exit before executing your event handler.
The technology used to find out if a user has closed their browser (or a best guess) is to use timeouts. Sessions will automatically timeout (this is configurable) - in asp.net the default is 20 minutes. If there is no activity, the timeout kicks in.

Resources