开发者

apache server with mod_wsgi + python as backend, how can i be able to notified my connection status?

开发者 https://www.devze.com 2023-03-30 05:49 出处:网络
i\'m trying to build a web server using apache as the http server, mod_wsgi + python as the logic handler, the server was supposed to handler long request without returning, meaning i want to keep wri

i'm trying to build a web server using apache as the http server, mod_wsgi + python as the logic handler, the server was supposed to handler long request without returning, meaning i want to keep writing stuff into this request. the problem is, when the link is broken, the socket is in a CLOSE_WAIT status, apache will NOT notify my python program, which means, i have to write something to get an exception, says the link is broken, but those messages were lost and can't be restored.

i tried to get the socket status before writing through /proc/net/tcp, but it could no开发者_JS百科t prevent a quick connect/break connection.

anybody has any ideas, please help, very much thanks in advance!


You cant. It is a limitation of the API defined by the WSGI specification. So, nothing to do with Apache or mod_wsgi really as you will have the same issue with any WSGI server if you follow the WSGI specification.

If you search through the mod_wsgi mailing list on Google Groups you will find a number of discussions about this sort of problem in the past.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号