packetchannellistener.java

来自「Examples to create your Conferencing Sys」· Java 代码 · 共 52 行

JAVA
52
字号
/*
 * Copyright 2004 WIT-Software, Lda. 
 * - web: http://www.wit-software.com 
 * - email: info@wit-software.com
 *
 * All rights reserved. Relased under terms of the 
 * Creative Commons' Attribution-NonCommercial-ShareAlike license.
 */
package handlers;

import java.nio.ByteBuffer;

/**
 * Callback interface for receiving events from a Connector. 
 * 
 * @author Nuno Santos
 */
public interface PacketChannelListener {
  /**
   * Called when a packet is fully reassembled.
   * 
   * @param pc The source of the event.
   * @param pckt The reassembled packet
   */
  public void packetArrived(PacketChannel pc, ByteBuffer pckt);
  
  /**
   * Called after finishing sending a packet.
   * 
   * @param pc The source of the event.
   * @param pckt The packet sent
   */
  public void packetSent(PacketChannel pc, ByteBuffer pckt);
  
  /**
   * Called when some error occurs while reading or writing to 
   * the socket.
   *  
   * @param pc The source of the event.
   * @param ex The exception representing the error.
   */
  public void socketException(PacketChannel pc, Exception ex);
    
  /**
   * Called when the read operation reaches the end of stream. This
   * means that the socket was closed.
   * 
   * @param pc The source of the event.
   */
  public void socketDisconnected(PacketChannel pc);
}

⌨️ 快捷键说明

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