Comments (7)
Can you try getting debug logs while this is happening? (feel free to ask how if necessary)
from mpd_client.
adding RUST_LOG=debug
didn't change the output but other than last time i tried, the unwrapping the command's Result doesn't error but it does in another function. investigating thisβ¦
from mpd_client.
I store the Client inside of a struct. While the first function works perfectly fine, at the start of the second function, the Client is already disconnected. The disconnect doesn't seem to just happen when a command is sent.
Both are functions are inside and impl and the Client is stored in the corresponding struct.
Does the client go out of scope and then disconnect or something? Also in the first function, the struct is borrowed as mutable so you can use .as_mut() on the Client and the unwrap() (Option). However, in the other function the struct is not borrowed at mutable and has to match the Option. Anna is wondering if the is part of the problem.
from mpd_client.
from mpd_client.
adding
RUST_LOG=debug
didn't change the output
You also need to install a subscriber, e.g. from the tracing_subscriber
crate (as simple as tracing_subscriber::fmt().init();
at the top of the main
function).
But I think I know what is happening: The runtime created here is dropped implicitly at the end of the scope, which in turn breaks the TCP connection used internally by this library. Keeping the runtime around as long as the Client
exists might already be sufficient to fix this behavior.
from mpd_client.
Does this still occur for you?
from mpd_client.
I'll close this for now, feel free to reopen if necessary.
from mpd_client.
Related Issues (14)
- Backpressure
- Getting state_changes fails with "you don't have permission for idle" on password protected MPD HOT 4
- Playlist (.m3u) in MPD database causes `ListAllIn` to fail HOT 3
- Add support for `sticker` commands HOT 1
- build failed HOT 1
- InvalidMessage when playing a song HOT 7
- Added replay_gain_mode and replay_gain_status HOT 3
- Add tests
- Patch: Added shuffle command and expanded Queue command HOT 5
- Update ahash version to above 0.8.9 HOT 4
- Add nicer List command implementation HOT 3
- Comparison to async-mpd? HOT 2
- Error: UnexpectedField "Last-Modified" on directory HOT 1
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 mpd_client.