2011-02-15 19:37:35 +00:00
|
|
|
package zutil.net.nio.server;
|
2008-11-14 16:38:36 +00:00
|
|
|
|
|
|
|
|
import java.net.InetSocketAddress;
|
|
|
|
|
import java.nio.channels.SocketChannel;
|
|
|
|
|
|
|
|
|
|
public class ClientData {
|
|
|
|
|
private SocketChannel socketChannel;
|
|
|
|
|
private long lastMessageReceived;
|
|
|
|
|
|
|
|
|
|
public ClientData(SocketChannel socketChannel){
|
|
|
|
|
this.socketChannel = socketChannel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SocketChannel getSocketChannel(){
|
|
|
|
|
return socketChannel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InetSocketAddress getAddress(){
|
|
|
|
|
return (InetSocketAddress) socketChannel.socket().getRemoteSocketAddress();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setLastMessageReceived(long time){
|
|
|
|
|
lastMessageReceived = time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public long getLastMessageReceived(){
|
|
|
|
|
return lastMessageReceived;
|
|
|
|
|
}
|
|
|
|
|
}
|