Client SocketListener // The Socket listener of the client Server SocketListener // The Socket server Client Socket(address) // Send data to the server ServerSocket.accept(address) // Receive data Switch(Socket){ // Jump to sub-modules case Location_Update: update user_data // Update user data update group_data // Update grouping data update group_location // Update a group location break case Location_Request: if(group_location valid) /* Determine if there is a latest group location satisfying precision requirements. */ Socket.output(group_location) else Socket.output(GPS_on_demand) break default: logout(“null”) }