短信发送
源代码在线查看: request.java
/**
* Created at Nov 10, 2008
*/
package com.jdev.net.queue;
import java.nio.channels.SocketChannel;
/**
* Title: Request
* Description: 客户端请求信息
* @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;
}
}