|  |  | 
 |  |  | import com.easysocket.interfaces.conn.ISocketActionListener; | 
 |  |  | import com.easysocket.utils.LogUtil; | 
 |  |  |  | 
 |  |  | import java.nio.charset.Charset; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * Author:Alex | 
 |  |  |  * Date:2019/6/4 | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     public EasySocket disconnect(boolean isNeedReconnect) { | 
 |  |  |         LogUtil.d("EasySocket--》disconnect"); | 
 |  |  |         getDefconnection().disconnect(isNeedReconnect); | 
 |  |  |         if (defConnection != null) { | 
 |  |  |             getDefconnection().disconnect(isNeedReconnect); | 
 |  |  |         } | 
 |  |  |         return this; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     public IConnectionManager getDefconnection() { | 
 |  |  |         if (defConnection == null) { | 
 |  |  |             throw new NotNullException("你还没有创建:" + defOptions.getSocketAddress().getIp() + ":" + defOptions.getSocketAddress().getPort() | 
 |  |  |                     + "的Socket的连接,请使用com.easysocket.EasySocket.connect()方法创建一个默认的连接"); | 
 |  |  | //            throw new NotNullException("你还没有创建:" + defOptions.getSocketAddress().getIp() + ":" + defOptions.getSocketAddress().getPort() | 
 |  |  | //                    + "的Socket的连接,请使用com.easysocket.EasySocket.connect()方法创建一个默认的连接"); | 
 |  |  |         } | 
 |  |  |         return defConnection; | 
 |  |  |     } |