Comments (4)
Author: alexjh
Checking out the latest repy_v2 branch from SVN, I am unable to reproduce this problem on either Mac OS X (my laptop) or on Linux (through blackbox). Is there a chance this has been fixed already, or is anybody able to reproduce the problem?
from repy_v2.
Author: mkaplan
I was able to reproduce this issue on my Linux machine:
Repy V2 revision 4872.
Linux version 2.6.38-11-generic (buildd@allspice) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) ) #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011
Python 2.6.6
On my Windows machine, the issue appears to be slightly different. The unit test fails in the normal case, when only one message is sent. However, if a second message is sent, it throws a exception_hierarchy.SocketClosedLocal
exception. The log is attached below.
Repy V2 revision 4872.
Windows 7 (x86)
Python 2.5
from repy_v2.
Author: vijay
By TCP rules, the only way for a server/client program to know if a server/client has disconnected,is to try to read from the socket. Specifically, if select() says there is data, but recv() returns 0 bytes of data, then this implies the client has disconnected.
A program might want to confirm that a tcp client is still connected without reading data. For example, before it performs some task or sends data to the client.
In our case as send() part is the problem focus,we will try to detect closed remote socket before sending data.
The method to do this:
select on socket (whose corresponding remote socket close we need to detect) as poll (no wait):Using select.select() especially on receiving function of the socket.
if no recv() data waiting, then remote side is still connected.
if recv() data waiting, the read one char using PEEK flag
if PEEK data len=0, then the remote side has disconnected, otherwise its connected.
In the following program sock is our socket whose corresponding remote socket close we need to detect.
from repy_v2.
Author: vijay
Committed r4929.Fixed this problem
from repy_v2.
Related Issues (20)
- `repy.py` option parser consumes arguments meant for the sandboxed program HOT 7
- Move logic to log to files from `repy.py` to `nmAPI.py`? HOT 2
- Clarify `repy.py` --logfile option help string HOT 5
- Should RepyV2 ever set `callfunc = "exit"`? HOT 2
- lack of netstat on modern versions of Linux
- Docs: Verify RepyV2 tutorial steps, code, etc. HOT 2
- Large UDP messages crash the sandbox HOT 5
- Promote warnings to errors? HOT 7
- `CheckNode/StrException`s in `safe.py` need better messages HOT 1
- Check for previously noted socket race condition
- Unmounting a live sandbox filesystem?
- Unit tests: Refactor ut_repyv2api_filecloseconcurrecy.py
- Unit tests: ut_repyv2api_commandlineargs.py leaves dangling Repy processes
- `SafeDict.update` needs `hasattr` HOT 3
- `namespace._copy` trips on `dict` values that are `type`s HOT 4
- `Exception` in a sandbox is not Python's `Exception` HOT 1
- `NameError` inside a virtual namespace causes Internal Error HOT 1
- Code safety error when Exception object has an `e.lineno` of `None`
- Fix issue references in comments HOT 2
- File object with input parameter long
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repy_v2.