연결 대기 없음 예외
연결 대기 없음 예외 (NoConnectionPendingException)
연결이 진행 중이 아닌데 SocketChannel의 finishConnect 메서드를 호출할 때 던져지는 unchecked 예외예요.
본문
NoConnectionPendingException은 SocketChannel의 finishConnect() 메서드를, 먼저 connect() 메서드가 성공적으로 호출되지 않은 상태에서 호출할 때 던져지는 unchecked exception이에요.
public class NoConnectionPendingException extends IllegalStateException
finishConnect()는 연결 작업이 진행 중일 때만(isConnectionPending()이 true) 호출해야 해요. IllegalStateException을 상속하므로 RuntimeException 계열이며, isConnectionPending()으로 상태를 확인하면 방지할 수 있어요.