001package ca.uhn.hl7v2.hoh.api; 002 003public interface IClientSimple extends IClient { 004 005 /** 006 * If a socket exists and it is connected, closes the socket. Only required 007 * if {@link #isAutoClose() auto close} mode is false 008 */ 009 public abstract void close(); 010 011 /** 012 * @return Should the socket auto-close 013 * @see #setAutoClose(boolean) 014 */ 015 public abstract boolean isAutoClose(); 016 017 /** 018 * @return Returns true if there is a socket, and it appears to be connected 019 * and not shut down 020 */ 021 public abstract boolean isConnected(); 022 023 /** 024 * <p> 025 * Sets the auto-close property. If set to true (which is the default), the 026 * client will close the socket between each request. If set to 027 * <code>false</code>, the client will keep the socket open between 028 * requests. 029 * </p> 030 * <p> 031 * If auto-close is disabled, sockets will never automatically disconnect, 032 * which some servers may not like. The socket can still be closed by 033 * calling {@link #close()}. 034 * </p> 035 */ 036 public abstract void setAutoClose(boolean theAutoClose); 037 038}