sslconnection.java

来自「Short Message Peer to Peer」· Java 代码 · 共 71 行

JAVA
71
字号
/*
 * Created on 2004-jul-12
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.smpp;

import java.io.IOException;

import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

/**
 * @author Sverker Abrahamsson
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class SSLConnection extends TCPIPConnection {

	/**
	 * Override the superclass SocketFactory with a SSLSocketFactory
	 */
	protected SocketFactory socketFactory = SSLSocketFactory.getDefault();

	/**
	 * Override the superclass ServerSocketFactory with a SSLServerSocketFactory
	 */
	protected ServerSocketFactory serverSocketFactory = SSLServerSocketFactory.getDefault();

	/**
	 * Initialises the connection with port only, which means that
	 * the connection will serve as connection receiving server.
	 * The accepting of the connection must be invoked explicitly by
	 * calling of <code>accept</code> method.
	 *
	 * @param port the port number to listen on
	 */
	public SSLConnection(int port) {
		super(port);
	}

	/**
	 * Initialises the connection for client communication.
	 *
	 * @param address  the address of the remote end
	 *                 of the <code>socket</code>
	 * @param port     the port number on the remote host
	 */
	public SSLConnection(String address, int port) {
		super(address, port);
	}

	/**
	 * Initialises the connection with existing socket.
	 * It's intended for use with one server connection which generates
	 * new sockets and creates connections with the sockets.
	 *
	 * @param sslsocket the socket to use for communication
	 * @see #accept()
	 * @throws IOException
	 */
	public SSLConnection(SSLSocket sslsocket) throws IOException {
		super(sslsocket);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?