edit crypto. Add check error in recv query. Add connect with ap server.