如何判断一个Socket对象当前是否处于连接状态?
A: boolean isConnected=socket.isConnected() && socket.isBound();
B: boolean isConnected=socket.isConnected() && !socket.isClosed();
C: boolean isConnected=socket.isConnected() && !socket.isBound();
D: boolean isConnected=socket.isConnected();
A: boolean isConnected=socket.isConnected() && socket.isBound();
B: boolean isConnected=socket.isConnected() && !socket.isClosed();
C: boolean isConnected=socket.isConnected() && !socket.isBound();
D: boolean isConnected=socket.isConnected();
举一反三
- 如何判断一个Socket对象当前是否处于连接状态( ) A: ooleanisConnected=socket.isConnected()&&socket.isBound(); B: ooleanisConnected=socket.isConnected()&&!socket.isClosed(); C: ooleanisConnected=socket.isConnected()&&!socket.isBound(); D: ooleanisConnected=socket.isConnected();
- 如何判断一个Socket对象当前是否处于连接状态
- 如何判断一个Socket对象当前是否处于连接状态?(单选)
- 下面哪个选项能正确创建socket连接()。 A: Socket s = new Socket(8080); B: Socket s = new Socket(“192.168.1.1”,”8080”) C: SocketServer s = new Socket(8080); D: Socket s = new SocketServer(“192.168.1.1”,”8080”);
- Socket 有流式 Socket、数据包 Socket 和原始 Socket 三种类型。参考答案: