?? identityserversocket.java
字號(hào):
/*
* 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;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -