Code example for DatagramSocket

Methods: close, isConnected

0
			} catch (final IOException e) {
				Globals.logError(this, "IO error while closing the tcp socket",
						e);
			} 
		} 
		if (udpSocket != null && udpSocket.isConnected()) {
			udpSocket.close();
		} 
	} 
 
	private void handleProtocol() throws IOException, InterruptedException { 
		if (disconnecting) {
			return; 
		} 
 
		out = new DataOutputStream(tcpSocket.getOutputStream());
		in = new DataInputStream(tcpSocket.getInputStream());
 
		final Version.Builder v = Version.newBuilder(); 
		v.setVersion(Globals.PROTOCOL_VERSION); 
		v.setOs("Android");