fix ping requests, jurastically improve file browser
This commit is contained in:
@@ -34,7 +34,6 @@ func (d *Dispatcher) Dispatch(ctx context.Context, envelope map[string]interface
|
||||
case "hello_ack":
|
||||
return HandleHelloAck(ctx, d.Env, envelope)
|
||||
case "ping":
|
||||
log.Printf("dispatcher: received ping")
|
||||
return HandlePing(ctx, d.Env, envelope)
|
||||
case "pong":
|
||||
return HandlePong(ctx, d.Env, envelope)
|
||||
|
||||
@@ -15,13 +15,11 @@ func HandlePing(ctx context.Context, env *runtime.Env, envelope map[string]inter
|
||||
if ts == 0 {
|
||||
ts = time.Now().UnixMilli()
|
||||
}
|
||||
log.Printf("ping: received ts=%d, sending pong", ts)
|
||||
pong := wire.Pong{Type: "pong", TS: ts}
|
||||
if err := wire.WriteMsg(ctx, env.Conn, pong); err != nil {
|
||||
log.Printf("ping: failed to send pong: %v", err)
|
||||
return err
|
||||
}
|
||||
log.Printf("ping: pong sent successfully")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user