Comments (7)
There is a unit test that checks that this work.
Can you show me how you trigger that issue?
from python-udsoncan.
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.
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](https://private-user-images.githubusercontent.com/64044980/319095624-a269183c-77ef-4d23-8901-8b79e6c8cdf1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMDA2MzYsIm5iZiI6MTcyMTIwMDMzNiwicGF0aCI6Ii82NDA0NDk4MC8zMTkwOTU2MjQtYTI2OTE4M2MtNzdlZi00ZDIzLTg5MDEtOGI3OWU2YzhjZGYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDA3MTIxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlYTI1MDY2MzllMGJkNWY2YWViMDIxNzQwNzZhYzlkMzU4OWVmN2Q3ZTBmNGY3NWJhYzkwNjBjZjZlYWVjOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.V1bHd3Ffv5XFSu909deQ8CLAn5yUmpBZcrGS3yDPIcU)
from python-udsoncan.
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.
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.
Following up on this, update?
I still never reproduced your issue. Would need some kind of code that reproduce.
from python-udsoncan.
If no update, I will close this issue
from python-udsoncan.
Related Issues (20)
- cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py) HOT 8
- Act as server and parse python-can messages HOT 6
- No data received: [TimeoutException] Problem HOT 12
- ReadDataByIdentifier: no codec.encode() ? HOT 6
- Security access SAPR response not correctly interpreted HOT 3
- WriteDataByIdentifier service execution returned a negative response IncorrectMessageLengthOrInvalidFormat (0x13) when data length is correct HOT 4
- Adding parameter to Communication Control Service(0x28) HOT 10
- SecurityAccess mishandes a level value of 0 HOT 3
- P2 timer issue on client.transfer_data(block_number, data HOT 22
- Runtime Error: Connection is not open HOT 2
- TimeoutError: timed out HOT 3
- Problem with waiting time to response longer than 1,658 seconds HOT 2
- isotp error handler not propagated to uds connection HOT 3
- Unable to read continuous frames HOT 1
- TimeoutException and request timeout not respected? HOT 9
- Slow response on Windows for transfer data HOT 11
- udsoncan.exceptions.TimeoutException: Did not receive response in time. P2 timeout time has expired HOT 13
- Can I use multiple RX addresses ? HOT 9
- Transport layer frame capture problem HOT 6
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 python-udsoncan.