Package io.grpc.internal
Interface InternalServer
@ThreadSafe
public interface InternalServer
An object that accepts new incoming connections on one or more listening socket addresses.
This would commonly encapsulate a bound socket that
accept()
s new connections.-
Method Summary
Modifier and TypeMethodDescriptionReturns the first listening socket address.List
<? extends SocketAddress> Returns a list of listening socket addresses.Returns the first listen socket stats of this server.Returns a list of listen socket stats of this server.void
shutdown()
Initiates an orderly shutdown of the server.void
start
(ServerListener listener) Starts transport.
-
Method Details
-
start
Starts transport. Implementations must not calllistener
until afterstart()
returns. The method only returns after it has done the equivalent of bind()ing, so it will be able to service any connections created after returning.- Parameters:
listener
- non-null
listener of server events- Throws:
IOException
- if unable to bind
-
shutdown
void shutdown()Initiates an orderly shutdown of the server. Existing transports continue, but new transports will not be created (onceServerListener.serverShutdown()
callback is called). This method may only be called once. Blocks until the listening socket(s) have been closed. If interrupted, this method will not wait for the close to complete, but it will happen asynchronously. -
getListenSocketAddress
SocketAddress getListenSocketAddress()Returns the first listening socket address. May change afterstart(ServerListener)
is called. -
getListenSocketStats
Returns the first listen socket stats of this server. May returnnull
. -
getListenSocketAddresses
List<? extends SocketAddress> getListenSocketAddresses()Returns a list of listening socket addresses. May change afterstart(ServerListener)
is called. -
getListenSocketStatsList
Returns a list of listen socket stats of this server. May returnnull
.
-