View Javadoc
1   package ca.uhn.hl7v2.util;
2   
3   import java.io.IOException;
4   import java.net.ServerSocket;
5   import java.net.Socket;
6   import java.net.SocketException;
7   
8   /**
9    * Pluggable socket factory interface
10   */
11  public interface SocketFactory {
12  
13  	/**
14  	 * Create a standard client socket
15  	 */
16  	Socket createSocket() throws IOException;
17  	
18  	/**
19  	 * Create a TLS client socket
20  	 */
21  	Socket createTlsSocket() throws IOException;
22  	
23  	/**
24  	 * Create a standard server socket
25  	 */	
26  	ServerSocket createServerSocket() throws IOException;
27  	
28  	/**
29  	 * Create a TLS server socket
30  	 */
31  	ServerSocket createTlsServerSocket() throws IOException;
32  
33  	/**
34  	 * Invoked by server processes each time a new server is {@link ServerSocket#accept() accepted}
35  	 * in order to set configuration settings on the new socket
36  	 */
37  	void configureNewAcceptedSocket(Socket theSocket) throws SocketException;
38  	
39  }