⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 request.java

📁 短信发送
💻 JAVA
字号:
/**
 * Created at Nov 10, 2008
 */
package com.jdev.net.queue;

import java.nio.channels.SocketChannel;

/**
 * <p>Title: Request</p>
 * <p>Description: 客户端请求信息</p>
 * @author Lawrence
 * @version 1.0
 */
public class Request {
	/**
	 * SelecableChannel 实现
	 */
	private SocketChannel sc;
	private byte[] dataInput = null;
	Object obj;
	
	private int dataType ;

	public Request(SocketChannel sc) {
		this.sc = sc;
	}

	public java.net.InetAddress getAddress() {
		return sc.socket().getInetAddress();
	}

	public int getPort() {
		return sc.socket().getPort();
	}

	public boolean isConnected() {
		return sc.isConnected();
	}

	public boolean isBlocking() {
		return sc.isBlocking();
	}

	public boolean isConnectionPending() {
		return sc.isConnectionPending();
	}

	public boolean getKeepAlive() throws java.net.SocketException {
		return sc.socket().getKeepAlive();
	}

	public int getSoTimeout() throws java.net.SocketException {
		return sc.socket().getSoTimeout();
	}

	public boolean getTcpNoDelay() throws java.net.SocketException {
		return sc.socket().getTcpNoDelay();
	}

	public boolean isClosed() {
		return sc.socket().isClosed();
	}

	public void attach(Object obj) {
		this.obj = obj;
	}

	public Object attachment() {
		return obj;
	}

	public byte[] getDataInput() {
		return dataInput;
	}

	public void setDataInput(byte[] dataInput) {
		this.dataInput = dataInput;
	}

	public void setDataType(int type) {
		this.dataType = type;
	}
	
	public int getDataType() {
		return this.dataType;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -