error in enet
cmdocmd opened this issue · 11 comments
Hello i was trying to connect to it to make sure its working but it wasnt print new connect! or disconnect! and it doesn't print error msgs as well so i tried to make this
loop {
println!("{:?}", host.service(1000).unwrap())
}
to see what is actually gives
so it was showing this
so i dont know where is the error exactly and im using the example of server
Hi!
This looks like there are no events arriving at the server, i.e., no client is connecting/disconnecting/sending data. Did you try running the example client at the same time? This should cause connections to occur on the server.
Hello again i didn't run client example with server example and yes i was trying to connect or disconnect but it didn't print new connection! or disconnect
Ok, then does it work if you start the example client while the example server is running? Then everything should work as intended.
i tried right now to start client with server but still doesn't receive any event
I just tried it locally again, and when I run cargo run --example server
in one terminal, and then cargo run --example client
in another, I successfully see events on both sides (connection, message and disconnection). How exactly do you start the examples?
i build the examples in IntelliJ and double click on the exe and btw if i open client while server is running client just close by it self
I sadly can't help with IntelliJ, as I don't use it myself. Maybe you can try the two commands in two terminals and see if they work then? If that works you can probably also get it to work in IntelliJ somehow.
i tried in cargo run -- example server but still same thing
Did you then also start an example client (cargo run --example client
) while the server was still running, so in another terminal window?
So it looks like you are not running the example server and client from this repository, but from your own code, which I can't really help with. I would suggest taking another look at the example client and server from this repo, try running them, to understand how the API needs to be used. Also, you can check out the official ENet website for further examples and documentation.
If the examples from this repo don't work that would be a bug. In that case please open an issue with an as-small-as-possible example of how to reproduce the failure.
For debugging your project I would recommend setting RUST_BACKTRACE=1
(as the compiler also suggested) to see where exactly the error originates. If this is the return value from a call to ENet itself, ENet's documentation should help with finding out what exactly is going wrong.
As this does not seem to point to anything wrong with the library, I'll close the issue, so please open a new one if you find the examples from this repository not working/find another bug. Thanks!