GithubHelp home page GithubHelp logo

Comments (4)

choksi81 avatar choksi81 commented on August 12, 2024

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.

choksi81 avatar choksi81 commented on August 12, 2024

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.

choksi81 avatar choksi81 commented on August 12, 2024

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.

choksi81 avatar choksi81 commented on August 12, 2024

Author: vijay
Committed r4929.Fixed this problem

from repy_v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.