private static boolean checkValidity ( ClientSocket client , byte from , StateConnection expected ) { return from >= 0 && client . getState ( ) == expected ; }
Check if the client is in a valid state .