📄 identityserversocket.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 + -