• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BOSHException类的典型用法和代码示例

java 2次浏览

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

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

示例1: sendPacket

点赞 2

import com.kenai.jbosh.BOSHException; //导入依赖的package包/类
public void sendPacket(Packet packet) {
    if (!isConnected()) {
        throw new IllegalStateException("Not connected to server.");
    }
    if (packet == null) {
        throw new NullPointerException("Packet is null.");
    }
    if (!done) {
        // Invoke interceptors for the new packet that is about to be sent.
        // Interceptors
        // may modify the content of the packet.
        firePacketInterceptors(packet);

        try {
            send(ComposableBody.builder().setPayloadXML(packet.toXML())
                    .build());
        } catch (BOSHException e) {
            e.printStackTrace();
            return;
        }

        // Process packet writer listeners. Note that we're using the
        // sending
        // thread so it's expected that listeners are fast.
        firePacketSendingListeners(packet);
    }
}
 

开发者ID:CJC-ivotten,
项目名称:androidPN-client.,
代码行数:28,
代码来源:BOSHConnection.java

示例2: send

点赞 2

import com.kenai.jbosh.BOSHException; //导入依赖的package包/类
/**
 * Send a HTTP request to the connection manager with the provided body element.
 * 
 * @param body the body which will be sent.
 */
protected void send(ComposableBody body) throws BOSHException {
    if (!connected) {
        throw new IllegalStateException("Not connected to a server!");
    }
    if (body == null) {
        throw new NullPointerException("Body mustn't be null!");
    }
    if (sessionID != null) {
        body = body.rebuild().setAttribute(
                BodyQName.create(BOSH_URI, "sid"), sessionID).build();
    }
    client.send(body);
}
 

开发者ID:CJC-ivotten,
项目名称:androidPN-client.,
代码行数:19,
代码来源:BOSHConnection.java

示例3: sendPacket

点赞 2

import com.kenai.jbosh.BOSHException; //导入依赖的package包/类
public void sendPacket(Packet packet) {
	if (!isConnected()) {
		throw new IllegalStateException("Not connected to server.");
	}
	if (packet == null) {
		throw new NullPointerException("Packet is null.");
	}
	if (!done) {
		// Invoke interceptors for the new packet that is about to be sent.
		// Interceptors
		// may modify the content of the packet.
		firePacketInterceptors(packet);

		try {
			send(ComposableBody.builder().setPayloadXML(packet.toXML())
					.build());
		} catch (BOSHException e) {
			e.printStackTrace();
			return;
		}

		// Process packet writer listeners. Note that we're using the
		// sending
		// thread so it's expected that listeners are fast.
		firePacketSendingListeners(packet);
	}
}
 

开发者ID:ikantech,
项目名称:xmppsupport_v2,
代码行数:28,
代码来源:BOSHConnection.java

示例4: send

点赞 2

import com.kenai.jbosh.BOSHException; //导入依赖的package包/类
/**
 * Send a HTTP request to the connection manager with the provided body
 * element.
 * 
 * @param body
 *            the body which will be sent.
 */
protected void send(ComposableBody body) throws BOSHException {
	if (!connected) {
		throw new IllegalStateException("Not connected to a server!");
	}
	if (body == null) {
		throw new NullPointerException("Body mustn't be null!");
	}
	if (sessionID != null) {
		body = body.rebuild()
				.setAttribute(BodyQName.create(BOSH_URI, "sid"), sessionID)
				.build();
	}
	client.send(body);
}
 

开发者ID:ikantech,
项目名称:xmppsupport_v2,
代码行数:22,
代码来源:BOSHConnection.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)