Code example for Socket

Methods: closegetRemoteSocketAddress

0
						shareButton.setEnabled(true);
						stopShareButton.setEnabled(false);
						connectionStatus.setTextColor(Color.RED);
						connectionStatus.setText("Not connected");
						try { 
							if(mainSocket.getRemoteSocketAddress()!=null) {
							mainSocket.close(); 
							mainSocket=null;
							} 
							editor.putString("ConnectionRequest", "STOP");
							editor.commit();
						} catch (IOException e) {
							// TODO Auto-generated catch block 
							e.printStackTrace();
						} 
						mainSocket=null;
			} 
			  
		 }); 
		  
Contextual code suggestions in your IDE  Get Codota for Java