-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with connection forwarding #179
Comments
Hi, The message sent |
Hi, thank you for your answer. I made an error while copying (since I tried different ports) but the error is always there it remains in pending. (btw It should be 8001 since i want that |
The problem is that You only should send data after receiving the
|
Also, note that here: if string2 == "8002" {
let (e, s) = handler.network().connect(Ws, "127.0.0.1:8000").unwrap();
println!("{:?}", handler.network().is_ready(e.resource_id()));
sleep(Duration::from_secs(1));
println!("{:?}", handler.network().is_ready(e.resource_id())); you do not need to wait if you use |
I don't think this is a good way of implementhing what I want to since it will lose the meaning of the messages (maybe I'm missing something but I'm preatty new to rust). My goal was to forward request to the server that has the resource that I'm looking for, or where I want to put something or connect to share information. To do so in the Connected event I need something like a channel where I'll write stuff and when I'll have more server the situation will be really hard to handle. I don't know if I understood it properly so maybe I'm missing something. How would you implement something like that with what you said? |
message-io follows an event driven pattern. Basically, you receive an event that means something for that endpoint. Depending of the connection event received, the connection is in a specific state. How you architect the application is up to you. The only thing message-io requires is that if you call To share some state, you can use the signals that comes along with messsge-io. |
I agree with what you said but is it normal that the Connected state will never be achieved inside match of the NetEvent? What I mean is that I can wait event 2 minutes or more for the handshake to finish BUT if I'm still inside the Message Event this connection won't finish the handshake. However if I finish the event whit connection after 1 second the connected state will be triggered. Like is it something wanted the behaviour that I described? The fact that the connection won't be made until the end of the event. |
The thread that finalizes the handshake is the event thread. That means that if you block the thread with an active waiting, the handshake can not finalize, and then the connection is not complete, even if you wait an infinite time. |
Hi, I have some problems related to connection forwarding and since i didn't find anything similar in the examples I'm writing my issue here.
The problem that I'm facing is related to the connection forwarding for one node. To put it simply if I have node A, B and C. If C sends a message to A in which it says to connect to B address, isReady of B will always be Some(false), and it will be impossible to send any message. Is it a normal behaviour? Is there something that I can do to solve this problem? Here is an example:
The text was updated successfully, but these errors were encountered: