$socket->on('login', function ($uid)use($socket){ global $uidConnectionMap; global $db; $uid1 = explode(',',$uid); $db = new \Workerman\MySQL\Connection('127.0.0.1', '3306', '...