Code example for Socket

Methods: connect, setKeepAlive, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTcpNoDelay

0
	} 
 
	@Override 
	public Object makeObject() throws Exception { 
		Socket _socket = socketFactory.openSocket(); 
		return new SocketConnectionImpl(_socket); 
	} 
 
	@Override 
	public void destroyObject(Object obj) throws Exception { 
		ISocketConnection _connection = (ISocketConnection) obj; 
		_connection.close(); 
	} 
 
	@Override 
	public boolean validateObject(Object obj) { 
		ISocketConnection _connection = (ISocketConnection) obj; 
		return _connection.isConnected(); 
	} 
 
	@Override 
	public void passivateObject(Object obj) throws Exception { 
		//什么也不做 
	} 
 
	@Override 
	public void activateObject(Object obj) throws Exception { 
		//什么也不做 
	} 
	 
}