📄 dxasyncclient.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-2000 by SMB GmbH. All rights reserved.//// $Id: DxAsyncClient.java,v 1.5 2000/10/28 16:55:15 daniela Exp $package org.ozoneDB.DxLib.net;import org.ozoneDB.DxLib.*;import java.io.*;import java.net.*;public abstract class DxAsyncClient extends DxClient implements Runnable { boolean cont; Thread _thread; private void init( boolean externalThread ) { cont = true; if (!externalThread) { _thread = new Thread( this ); _thread.setPriority( Thread.NORM_PRIORITY ); _thread.setDaemon( true ); _thread.start(); } } public DxAsyncClient( String host, int port, boolean externalThread ) throws IOException{ super( host, port ); init( externalThread ); } public DxAsyncClient( Socket s, boolean externalThread ) throws IOException{ super( s ); init( externalThread ); } public Thread thread() { return _thread; } public void run() { try { while (cont) { handleEvent( receive() ); } } catch (Exception e) { System.out.println( "DxAsyncClient: " + e ); } } public synchronized void close() throws IOException { cont = false; if (_thread != null) { _thread.stop(); } super.close(); } public abstract void handleEvent( Object event );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -