Commit e3392ac
committed
Fix ready channel race condition and implement Neko heartbeat protocol
Bug 1: In Start(), only replace the ready channel if the previous one
was already closed (reconnection case). Previously, Start() always
created a new channel, orphaning the one from NewRelay() and causing
the first client to always time out with a 503.
Bug 2: Extract heartbeat_interval from system/init payload and start
a periodic client/heartbeat sender. Remove dead system/heartbeat
handler (Neko never sends this event; it sends system/pong in
response to client-initiated heartbeats).1 parent 6e0ae57 commit e3392ac
1 file changed
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| |||
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
127 | | - | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
131 | 162 | | |
132 | 163 | | |
133 | 164 | | |
| |||
502 | 533 | | |
503 | 534 | | |
504 | 535 | | |
505 | | - | |
| 536 | + | |
506 | 537 | | |
507 | 538 | | |
508 | 539 | | |
509 | | - | |
| 540 | + | |
510 | 541 | | |
511 | 542 | | |
512 | 543 | | |
513 | | - | |
| 544 | + | |
514 | 545 | | |
515 | 546 | | |
516 | 547 | | |
| |||
545 | 576 | | |
546 | 577 | | |
547 | 578 | | |
548 | | - | |
549 | | - | |
550 | 579 | | |
551 | 580 | | |
552 | 581 | | |
| |||
0 commit comments