Module 11 Β· Live Walk Tracking β Lesson 2 of 4 Β· ~11 min
Sockets & Location: Fixes In, Fixes Out
One socket per booking
connect(bookingId) runs in viewModelScope.launch (Module 3's coroutine-launching pattern). It resolves which booking to track β the one it's given, or the caller's most recent active booking β then reads the bearer token from TokenStore (Module 8) and opens a WebSocket.
A WebSocket is a connection that, once opened, stays open: either side can send a message at any time, instead of the request-reply-done shape every other screen in this app uses. PawWalk opens one WebSocket per booking β the walker's phone sends GPS fixes up the wire, and every phone watching that booking receives them.