Code example for Socket

Methods: closeisConnectedshutdownInputshutdownOutput

0
Socket mSocket;
			if (mState != STATE_NORMAL) {
				// close remote socket 
				mSocket = this.remote;
				if (mSocket != null && mSocket.isConnected()) {
					try { 
						mSocket.shutdownInput();
						mSocket.shutdownOutput();
					} catch (IOException e) {
						Log.d(TAG, null, e);
					} 
					mSocket.close();
				} 
				this.remote = null;
			} 
			if (mState == STATE_CLOSED_OUT) {
				// close local socket 
				mSocket = this.local;
				if (mSocket.isConnected()) {
Contextual code suggestions in your IDE  Get Codota for Java