Code Monkey home page Code Monkey logo

Comments (7)

pylessard avatar pylessard commented on July 18, 2024

There is a unit test that checks that this work.
Can you show me how you trigger that issue?

from python-udsoncan.

pylessard avatar pylessard commented on July 18, 2024

Is it possible that you call open and close one after the other without waiting?
I think there's a weakness in that case

Try to reproduce your error and then try this branch : fix_socket_connection_that_blocks_on_open_close

let me know the outcome

from python-udsoncan.

nada-ben-ali avatar nada-ben-ali commented on July 18, 2024

Problem trigger:

  • sock = socketPool.get(ip, port, connection_name) # socketPool is a pool of open tcp sockets in the test, so it checks if the socket is still open otherwise it creates it if it's closed or if it's a new socket.

  • Create the connector using the returned socket: SocketConnection(sock=sock)

  • create the client by opening the connection using socketConnection.open

  • send a diag after checking that the connection is not closed using SocketConnection.specific_send(payload, timeout=None) --> no problem with sending the diag

  • we've received a positive response

  • it stucks when closing the connection in self.rxthread.join().

I've tested your branch and the same problem still occurs. When opening the connection, self.started_event.is_set() was not True, so it closes the connection and then stucks in self.rxthread.join().

image

from python-udsoncan.

pylessard avatar pylessard commented on July 18, 2024

Something does not make sense, You say that the the thread never starts but you are able to send and receive.

Are you able to write a demo script that recreate the issue and share that with me?
I just don't see how this can happen...

from python-udsoncan.

nada-ben-ali avatar nada-ben-ali commented on July 18, 2024

The thread never starts using the branch you provided with which I was unable to send or receive, it just gets stuck when opening the connection. But without the branch, I'm able to send and receive, but when I close the connection, it stucks.

I will try to make a small script.

from python-udsoncan.

pylessard avatar pylessard commented on July 18, 2024

Following up on this, update?
I still never reproduced your issue. Would need some kind of code that reproduce.

from python-udsoncan.

pylessard avatar pylessard commented on July 18, 2024

If no update, I will close this issue

from python-udsoncan.

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.