⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 identityserversocket.java

📁 《精通RMI:Java与EJB企业级应用开发》书籍的源代码. 本书是讲述RMI技术的经典著作
💻 JAVA
字号:
/*
 * Copyright 1999 by dreamBean Software,
 * All rights reserved.
 */
package masteringrmi.hellosocket.server;

import java.io.IOException;
import java.net.Socket;
import java.net.ServerSocket;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import masteringrmi.hellosocket.interfaces.IdentitySocket;

/**
 *   This is a custom server socket. It can be used to accept
 *   connections from an IdentitySocket.   
 *      
 *   @see HelloWorld
 *   @author Rickard 謆erg
 *   @version $Revision:$
 */
public class IdentityServerSocket
   extends ServerSocket
{
   // Attributes ----------------------------------------------------
   
   
   // Constructors --------------------------------------------------

   /**
    *   Create a new server socket
    *
    * @param   port  the port which it should listen to
    * @exception   IOException  thrown if creation failed
    */
   protected IdentityServerSocket(int port)
      throws IOException
   {
      super(port);
   }
      
   // Constructors --------------------------------------------------

   // Public --------------------------------------------------------

   /**
    *   Listen for incoming connection requests, and create a socket 
    *   with which to talk to the client.
    *
    * @return     a socket connected to a client
    * @exception   IOException  thrown if connection creation failed
    */
   public Socket accept()
      throws IOException
   {
      Socket socket = new IdentitySocket();
      implAccept(socket);
      return socket;
   }
}

⌨️ 快捷键说明

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