當前位置: 首頁>>代碼示例>>Java>>正文


Java DisconnectInfo類代碼示例

本文整理匯總了Java中com.jme3.network.ClientStateListener.DisconnectInfo的典型用法代碼示例。如果您正苦於以下問題:Java DisconnectInfo類的具體用法?Java DisconnectInfo怎麽用?Java DisconnectInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DisconnectInfo類屬於com.jme3.network.ClientStateListener包,在下文中一共展示了DisconnectInfo類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: closeConnections

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
protected void closeConnections( DisconnectInfo info )
{
    if( !isRunning )
        return;

    // Send a close message

    // Tell the thread it's ok to die
    if( fastAdapter != null ) {
        fastAdapter.close();
    }
    if( reliableAdapter != null ) {
        reliableAdapter.close();
    }
    
    // Wait for the threads?

    // Just in case we never fully connected
    connecting.countDown();
    
    fireDisconnected(info);
    
    isRunning = false;
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:25,代碼來源:DefaultClient.java

示例2: handleError

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
/**
 *  Either calls the ErrorListener or closes the connection
 *  if there are no listeners.  
 */ 
protected void handleError( Throwable t )
{
    // If there are no listeners then close the connection with
    // a reason
    if( errorListeners.isEmpty() ) {
        log.log( Level.SEVERE, "Termining connection due to unhandled error", t );
        DisconnectInfo info = new DisconnectInfo();
        info.reason = "Connection Error";
        info.error = t;
        closeConnections(info);
        return;
    }

    for( ErrorListener l : errorListeners ) {
        l.handleError( this, t );
    } 
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:22,代碼來源:DefaultClient.java

示例3: dispatch

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
protected void dispatch( Message m )
{
    // Pull off the connection management messages we're
    // interested in and then pass on the rest.
    if( m instanceof ClientRegistrationMessage ) {
        // Then we've gotten our real id
        this.id = (int)((ClientRegistrationMessage)m).getId();
        log.log( Level.INFO, "Connection established, id:{0}.", this.id );
        connecting.countDown();
        fireConnected();
        return;
    } if( m instanceof DisconnectMessage ) {
        // Can't do too much else yet
        String reason = ((DisconnectMessage)m).getReason();
        log.log( Level.SEVERE, "Connection terminated, reason:{0}.", reason );
        DisconnectInfo info = new DisconnectInfo();
        info.reason = reason;
        closeConnections(info);
    }

    // Make sure client MessageListeners are called single-threaded
    // since it could receive messages from the TCP and UDP
    // thread simultaneously.
    synchronized( this ) {
        messageListeners.messageReceived( this, m );
    }
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:28,代碼來源:DefaultClient.java

示例4: fireDisconnected

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
protected void fireDisconnected( DisconnectInfo info )
{
    for( ClientStateListener l : stateListeners ) {
        l.clientDisconnected( this, info );
    }            
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:7,代碼來源:DefaultClient.java

示例5: clientDisconnected

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
public void clientDisconnected(Client c, DisconnectInfo info) {
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:3,代碼來源:ObjectStore.java

示例6: clientDisconnected

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
@Override
public final void clientDisconnected(final GameClient gameClient,  final DisconnectInfo info) {
    onClientDisconnected(gameClient, info);
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:5,代碼來源:AbstractClientListener.java

示例7: onClientDisconnected

import com.jme3.network.ClientStateListener.DisconnectInfo; //導入依賴的package包/類
/**
 * 當客戶端斷開連接時,這個方法發生在客戶端斷開與服務端的連接後調用。
 * @param gameClient
 * @param info 
 */
protected abstract void onClientDisconnected(GameClient gameClient, DisconnectInfo info);
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:7,代碼來源:AbstractClientListener.java


注:本文中的com.jme3.network.ClientStateListener.DisconnectInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。