futile / enet-rs

High-level bindings for the ENet networking library (http://enet.bespin.org)
Other
39 stars 21 forks source link

error #8

Closed cmdocmd closed 4 years ago

cmdocmd commented 4 years ago

d2

d2

d2

everything is from this repo just changed the port and made it UNSPECIFIED instead of localhost

futile commented 4 years ago

Hi, were you able to solve your issue? :)

cmdocmd commented 4 years ago

not really still wondering why its not working

futile commented 4 years ago

You can also try cloning this repo and then running cargo run --example server and cargo run --example client and see if those work. I'll try your adjustments locally as well.

futile commented 4 years ago

Ok, so if all I do is change the listening IP address to Ipv4Addr::UNSPECIFIED, the example server and client still continue to work fine.

Try cloning this repo and running both the example server and client with RUST_BACKTRACE=1 (have to set this as an environment variable) so we can see where exactly it crashes.

cmdocmd commented 4 years ago

d2

i tried to make cargo test got this error

cmdocmd commented 4 years ago

and here when i enabled rust_backtace=1 https://pastebin.com/ZT4W94j8 and i didnt change anything from this repo just installed it made cargo build then cargo test

futile commented 4 years ago

So it seems that enet_address_set_host() in src/address.rs:29 seems to return an error. The ENet-function that is called there is this one: http://enet.bespin.org/group__Address.html#ga979aff1766944d841950c35b57705b49

This is really weird and seems to be some enet-internal problem. You can try changing the address it tries to bind to from "localhost" to "127.0.0.1" in the test (so in line 86 in address.rs). That also works locally for me as well, don't really see what's going wrong here.

cmdocmd commented 4 years ago

d2

okay when i changed it to 127.0.0.1 and run cargo test it didnt show any error but when i tried to connect still doesn't receive any event

cmdocmd commented 4 years ago

update: it is receiving packet from client now but is it possible to receive packet from a game ?

futile commented 4 years ago

That's great to hear! Sorry I didn't reply for a while. Was there some error in this library that caused the problem? And what exactly do you mean by 'receiving a packet from a game'? Does the example client successfully send a packet to the server, which then prints a message?