disconnect

HTTP disconnect/timeout between request and response handling

谁说胖子不能爱 提交于 2019-12-04 02:27:27
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 such scenario in HTTP documentation. My question are: a) should client expect that his data MAY be

node.js doesn't send socket on disconnect event

走远了吗. 提交于 2019-12-04 00:42:21
问题 When someone connects to the node server, I keep an array with all the sockets. That way I can broadcast messages to everyone whenever that is needed or loop through the users to count the number of online users, etc. All this works fine, but when a on disconnect event is fired, I don't receive a socket in my arguments. Is there another way to know which socket just disconnected? var allClients = []; io.sockets.on('connection', function(socket) { allClients.push(socket); socket.on('disconnect

Disconnect from ssh2_connect()

痞子三分冷 提交于 2019-12-03 22:43:02
I've connected over ssh2 using ssh2_connect to a server, but I don't see any method in the manpages for how I should end the connection. I'm not exactly a fan of waiting for a script to end before I disconnect. Can I use fclose ? That doesn't sound right... Just unset($connection) your connection variable or ssh2_exec($connection, 'exit'); might do it. You could probably do the following in order to be even more convincing! ssh2_exec($connection, 'exit'); unset($connection); If you were using phpseclib, a pure PHP SSH implementation , you could do $ssh->disconnect() . phpseclib's destructor

ffmpeg rtmp and local file output

家住魔仙堡 提交于 2019-12-03 22:30:23
问题 I have a trouble with ffmpeg I receive a rtsp stream from a grabbing device (camera) and I stream-out it to rtmp (Youtube Live) I want to have a copy of the stream in my computer so I write at the same time in a local file I use this command : ffmpeg -y -i 'RTSP_SOURCE' -c:v copy -c:a libvo_aacenc -map 0:v -bsf:v dump_extra -fflags +genpts -flags +global_header -movflags +faststart -map_metadata 0 -metadata title= -f tee -filter_complex aevalsrc=0 '[f=mp4]/tmp/backup.mp4|[f=mpegts]/tmp/backup

how we can end the session of praticular user in XMPP and logout form the chat

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Button logout = (Button) this.findViewById(R.id.btlogout); logout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub connection.disconnect(); setContentView(R.layout.login); } }); this code is allowing me logout but not killing the session and the page which i am redirecting that page's button is not working . 回答1: First of all send presence packet to server and then you should logout. This way your session will be killed. Presence pr=new Presence(Presence.Type

Socket.IO: How do I remove a namespace

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to be able to construct and destruct socket.io namespaces on-the-fly. It is easily to find information how to create a namespace, but I find nothing about how I remove/disconnect the namespace to release its memory. Say I got the following code already running: var nsp = io.of('/my-namespace'); nsp.on('connection', function(socket){ console.log('someone connected'): }); nsp.emit('hi', 'everyone!'); How do I disconnect/remove the socket.io namespace created above? 回答1: The io.of method just creates an array element: Server.prototype.of

Socket.io : How to perform certain action while reconnecting after disconnection?

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using node.js and socket.io for building a game . I have the code as below . The game is simple . It starts doing some animation as soon as it connects to the server and it keeps animating. I want to make sure that the game fails gracefully if the internet connection goes down or if the server gets disconnected .And the game gets back once the connection is back up . The animate function fetches content from the server . Hence it will not work properly if there is no connection . I want the animate function to get executed

should I commit in the following code?

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My code: 122 # 123 my $hfpDbh = undef; 124 unless ( 125 $hfpDbh = DBI->connect("dbi:Pg:host=....")#removed something 128 ) { 129 Log( ERROR, "" ); 130 Exit( 1 ) 131 } 132 $hfpDbh->{RaiseError} = 1; 133 $hfpDbh->{AutoCommit} = 0; 134 135 ( my $mydata, $msg ) = load_data( $hfpDbh, $DatFile ); 136 unless ( defined($mydata) ) 137 { 138 Log(INFO, "Calling exit...2"); 139 } 140 #$hfpDbh->disconnect(); 141 Exit( 0 ); 142 Log(INFO, "Calling exit...4"); 143 144 145 sub load_data 146 { 147 my ( $dbh, $DatFile ) = @_; 148 my $msg = ''; 149 unless (

socket.io: disconnect event isn't fired

送分小仙女□ 提交于 2019-12-03 04:46:07
问题 I have made a simple realtime visitor counter. You can download it from this repository. What happens is that disconnect event (even after browser closing) on server is never fired. server.js is: (function () { var app, count, express, io; express = require('express'); io = require('socket.io'); app = module.exports = express.createServer(); app.configure(function () { app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express

Disconnect from ssh2_connect()

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've connected over ssh2 using ssh2_connect to a server, but I don't see any method in the manpages for how I should end the connection. I'm not exactly a fan of waiting for a script to end before I disconnect. Can I use fclose ? That doesn't sound right... 回答1: Just unset($connection) your connection variable or ssh2_exec($connection, 'exit'); might do it. You could probably do the following in order to be even more convincing! ssh2_exec($connection, 'exit'); unset($connection); 回答2: If you were using phpseclib, a pure PHP SSH