Skip to content
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

refactor(engineio/engine): transport module #106

Merged
merged 14 commits into from
Oct 16, 2023
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/src/engineioxide.rs
Original file line number Diff line number Diff line change
@@ -20,10 +20,10 @@ impl EngineIoHandler for MyHandler {
type Data = ();

fn on_connect(&self, socket: Arc<Socket<Self::Data>>) {
println!("socket connect {}", socket.sid);
println!("socket connect {}", socket.id);
}
fn on_disconnect(&self, socket: Arc<Socket<Self::Data>>, reason: DisconnectReason) {
println!("socket disconnect {}: {:?}", socket.sid, reason);
println!("socket disconnect {}: {:?}", socket.id, reason);
}

fn on_message(&self, msg: String, socket: Arc<Socket<Self::Data>>) {
4 changes: 2 additions & 2 deletions e2e/src/socketioxide.rs
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.build_svc();

io.ns("/", |socket, data: Value| async move {
info!("Socket.IO connected: {:?} {:?}", socket.ns(), socket.sid);
info!("Socket.IO connected: {:?} {:?}", socket.ns(), socket.id);
socket.emit("auth", data).ok();

socket.on("message", |socket, data: Value, bin, _| async move {
@@ -38,7 +38,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});
});
io.ns("/custom", |socket, data: Value| async move {
info!("Socket.IO connected on: {:?} {:?}", socket.ns(), socket.sid);
info!("Socket.IO connected on: {:?} {:?}", socket.ns(), socket.id);
socket.emit("auth", data).ok();
});
info!("Starting server");
Loading
Loading