| :
****************************************************************************** * Copyright (c) 2011, 2012 EclipseSource and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * EclipseSource - initial API and implementation ******************************************************************************/ package org.eclipse.rap.rwt.cluster.testfixture.internal.server; import java.io.IOException; import java.net.ServerSocket; import org.eclipse.rap.rwt.cluster.testfixture.internal.util.SocketUtil; public class ServerSocketFactory { private final int port; private ServerSocket serverSocket; public ServerSocketFactory( int port ) { this.port = port; } public ServerSocket createServerSocket() throws IOException { if( serverSocket == null ) { serverSocket = SocketUtil.createServerSocket( port ); } return serverSocket; } public void close() throws IOException { if( serverSocket != null ) { serverSocket.close(); } } }
ǸҳܰȨ۳ʱ踶ѹ
˴
ɨ븶Ѽɸ
ݴ | Ŀĵַ· | | | ز | ͳ | | 澯ָʾ | ѹ | | ʱʱ | |