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


Java INonBlockingConnection类代码示例

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


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

示例1: onData

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final boolean onData(INonBlockingConnection con)
{
	final NetEvent event = new NetEvent(con);
	server.serverPacketQueue.add(event);

	return true;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:8,代码来源:NetHandler.java

示例2: onConnectionTimeout

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final boolean onConnectionTimeout(INonBlockingConnection con)
{
	final NetEvent event = new NetEvent(con, 1);
	server.serverPacketQueue.add(event);

	return true;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:8,代码来源:NetHandler.java

示例3: onIdleTimeout

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final boolean onIdleTimeout(INonBlockingConnection con)
{

	final NetEvent event = new NetEvent(con, 2);
	server.serverPacketQueue.add(event);

	return true;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:9,代码来源:NetHandler.java

示例4: onDisconnect

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final boolean onDisconnect(INonBlockingConnection con)
{
	final NetEvent event = new NetEvent(con, 3);
	server.serverPacketQueue.add(event);

	return true;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:8,代码来源:NetHandler.java

示例5: onConnect

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final boolean onConnect(INonBlockingConnection con)
{
	final NetEvent event = new NetEvent(con, 4);
	server.serverPacketQueue.add(event);

	return true;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:8,代码来源:NetHandler.java

示例6: onConnect

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
@Override
public boolean onConnect(INonBlockingConnection iNonBlockingConnection) throws IOException, BufferUnderflowException
{
  logger.info("Connection to socket server established");
  connected = true;
  return true;
}
 
开发者ID:theone1984,项目名称:parroteer,代码行数:8,代码来源:SocketClient.java

示例7: onDisconnect

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
@Override
public boolean onDisconnect(INonBlockingConnection iNonBlockingConnection) throws IOException
{
  logger.info(String.format("Connection to socket server disconnected - retrying connect in %d seconds", RECONNECT_TIMEOUT_SECONDS));
  connected = false;

  tryReconnect();
  return true;
}
 
开发者ID:theone1984,项目名称:parroteer,代码行数:10,代码来源:SocketClient.java

示例8: onData

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
@Override
public boolean onData(INonBlockingConnection connection)
{
  String[] messages = getMessagesFromConnection(connection);
  if (messages != null)
  {
    invokeCallbacksForMessages(messages);
  }
  return true;
}
 
开发者ID:theone1984,项目名称:parroteer,代码行数:11,代码来源:SocketClient.java

示例9: getMessagesFromConnection

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
private String[] getMessagesFromConnection(INonBlockingConnection connection)
{
  String[] messages = null;
  try
  {
    String content = connection.readStringByDelimiter(LINE_TERMINATION_STRING);
    messages = content.split(LINE_TERMINATION_PATTERN);
  } catch (Exception e)
  {
    logger.warn(String.format("Receiving data failed: %s", e.getMessage()));
  }
  return messages;
}
 
开发者ID:theone1984,项目名称:parroteer,代码行数:14,代码来源:SocketClient.java

示例10: addPerson

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public final Player addPerson(INonBlockingConnection connection)
{
	int newIndex = findIndex();

	if (newIndex != -1)
	{
		Players[newIndex].connection = connection;

		Players[newIndex].Index = newIndex;
		Players[newIndex].inUse = true;
		Players[newIndex].Verified = false;
		Players[newIndex].State = 0;
		Players[newIndex].Team = -1;

		Players[newIndex].packet = null;
		Players[newIndex].DisableUDP = false;
		Players[newIndex].EstablishedUDP = false;
		Players[newIndex].SendCounter = 0;
		Players[newIndex].ReceiveCounter = -1;
		Players[newIndex].GoodPackets = 0;

		Players[newIndex].Score = 0;
		Players[newIndex].X = 0;
		Players[newIndex].Y = 0;
		Players[newIndex].timeWarp = 0;
		Players[newIndex].WarpIndex = 0;

		Players[newIndex].MovedInPen = false;
		Players[newIndex].timeSpawn = 0;
		Players[newIndex].timeDead = 0;

		Players[newIndex].MissileCharges = 0;
		Players[newIndex].MissileRecharge = 0;
		Players[newIndex].GrenadeCharges = 0;
		Players[newIndex].GrenadeRecharge = 0;
		Players[newIndex].BouncyCharges = 0;
		Players[newIndex].BouncyRecharge = 0;

		Players[newIndex].timeCorrectPosition = 0;
		Players[newIndex].timeTeamSwitch = 0;
		Players[newIndex].timestampLastEpoch = 0;
		Players[newIndex].timestampLastTick = 0;

		return Players[newIndex];
	}
	else
	{
		return null;
	}
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:51,代码来源:PlayerList.java

示例11: Player

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public Player(SparkServer server, INonBlockingConnection connection)
{
	this.server = server;
	this.connection = connection;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:6,代码来源:Player.java

示例12: NetEvent

import org.xsocket.connection.INonBlockingConnection; //导入依赖的package包/类
public NetEvent(INonBlockingConnection con)
{
	this.con = con;
	this.Type = 0;
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:6,代码来源:NetEvent.java


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