adminmessport.java

来自「用Java写的面相对象的数据库管理系统」· Java 代码 · 共 42 行

JAVA
42
字号
// 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: AdminMessPort.java,v 1.12 2000/10/28 16:55:20 daniela Exp $package org.ozoneDB.tools;import java.io.*;import org.ozoneDB.DxLib.net.*;import org.ozoneDB.core.*;import org.ozoneDB.util.*;public class AdminMessPort extends DxAsyncClient {    IODevice device;            public AdminMessPort( IODevice dev, String host, int port ) throws IOException{        super( host, port, false );        device = dev;    }            public void onConnect() throws IOException {        send( "Message" );    }             public void onDeconnect() throws IOException {        send( new AdminCommand( AdminCommand.CLOSE ) );    }             public synchronized void handleEvent( Object event ) {        AdminMessage msg = (AdminMessage)event;        device.asyncMessage( "Message from " + msg.sender + " : " + msg.msg );    } }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?