本文整理汇总了Java中org.spacehq.packetlib.Client类的典型用法代码示例。如果您正苦于以下问题:Java Client类的具体用法?Java Client怎么用?Java Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Client类属于org.spacehq.packetlib包,在下文中一共展示了Client类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import org.spacehq.packetlib.Client; //导入依赖的package包/类
public void connect( String host, int port, SessionListener listener )
{
HOST = host;
PORT = port;
Main.debug( "Attempting to connect to " + HOST + "..." );
client = new Client( HOST, PORT, protocol, new TcpSessionFactory() );
session = client.getSession();
session.addListener( listener );
session.connect();
Main.debug( "Connected successfully" );
connected = true;
}
示例2: newClientSession
import org.spacehq.packetlib.Client; //导入依赖的package包/类
@Override
public void newClientSession(final Client client, final Session session) {
if (this.profile != null) {
session.setFlag(ProtocolConstants.PROFILE_KEY, this.profile);
session.setFlag(ProtocolConstants.ACCESS_TOKEN_KEY, this.accessToken);
}
this.setMode(this.mode, true, session);
session.addListener(this.clientListener);
}
示例3: getClient
import org.spacehq.packetlib.Client; //导入依赖的package包/类
public Client getClient()
{
return client;
}
示例4: newClientSession
import org.spacehq.packetlib.Client; //导入依赖的package包/类
@Override
public void newClientSession(Client client, Session session) {
// We don't do client
}
示例5: createClientSession
import org.spacehq.packetlib.Client; //导入依赖的package包/类
@Override
public Session createClientSession(Client client) {
// We don't connect to others
return null;
}
示例6: getClient
import org.spacehq.packetlib.Client; //导入依赖的package包/类
public Client getClient() { return client; }