当前位置: 首页>>代码示例>>Java>>正文


Java ErrorListener类代码示例

本文整理汇总了Java中com.jme3.network.ErrorListener的典型用法代码示例。如果您正苦于以下问题:Java ErrorListener类的具体用法?Java ErrorListener怎么用?Java ErrorListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ErrorListener类属于com.jme3.network包,在下文中一共展示了ErrorListener类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ConnectorAdapter

import com.jme3.network.ErrorListener; //导入依赖的package包/类
public ConnectorAdapter( Connector connector, MessageListener<Object> dispatcher, 
                         ErrorListener<Object> errorHandler, boolean reliable )
{
    super( String.valueOf(connector) );
    this.connector = connector;        
    this.dispatcher = dispatcher;
    this.errorHandler = errorHandler;
    this.reliable = reliable;
    setDaemon(true);        
    writer = Executors.newFixedThreadPool(1, 
                        new NamedThreadFactory(String.valueOf(connector) + "-writer", true));
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:ConnectorAdapter.java

示例2: ConnectorAdapter

import com.jme3.network.ErrorListener; //导入依赖的package包/类
public ConnectorAdapter( Connector connector, MessageListener<Object> dispatcher, 
                         ErrorListener<Object> errorHandler, boolean reliable )
{
    super( String.valueOf(connector) );
    this.connector = connector;        
    this.dispatcher = dispatcher;
    this.errorHandler = errorHandler;
    this.reliable = reliable;
    setDaemon(true);
 
    // The backlog makes sure that the outbound channel blocks once
    // a certain backlog level is reached.  It is set high so that it
    // is only reached in the worst cases... which are usually things like
    // raw throughput tests.  Technically, a saturated TCP channel could
    // back up quite a bit if the buffers are full and the socket has
    // stalled but 16,000 messages is still a big backlog.       
    outbound = new ArrayBlockingQueue<ByteBuffer>(OUTBOUND_BACKLOG); 
 
    // Note: this technically adds a potential deadlock case
    // with the above code where there wasn't one before.  For example,
    // if a TCP outbound queue fills to capacity and a client sends
    // in such a way that they block TCP message handling then if the HostedConnection
    // on the server is similarly blocked then the TCP network buffers may
    // all get full and no outbound messages move and we forever block
    // on the queue.
    // However, in practice this can't really happen... or at least it's
    // the sign of other really bad things.
    // First, currently the server-side outbound queues are all unbounded and
    // so won't ever block the handling of messages if the outbound channel is full.
    // Second, there would have to be a huge amount of data backlog for this
    // to ever occur anyway.
    // Third, it's a sign of a really poor architecture if 16,000 messages
    // can go out in a way that blocks reads. 
    
    writer = new WriterThread();
    writer.start();                                           
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:38,代码来源:ConnectorAdapter.java


注:本文中的com.jme3.network.ErrorListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。