com.ibm.net.rdma.jverbs.endpoints
Class RdmaServerEndpoint<C extends RdmaEndpoint>
- java.lang.Object
-
- com.ibm.net.rdma.jverbs.endpoints.RdmaServerEndpoint<C>
-
public class RdmaServerEndpoint<C extends RdmaEndpoint> extends java.lang.ObjectRepresent a server endpoint. Conceptually it is similar to a server socket. RdmaServerEndpoint need to bind and listen for any incoming connection requests and accept.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Caccept()Initiates the accept and waits for connect request.RdmaServerEndpoint<C>bind(java.net.SocketAddress srcAddress, int backlog)Bind this server endpoint to a specific IP address / port.voidclose()Close this endpoint.ConnectionIdgetConnectionId()Gets the ConnectionId for this endpoint.java.net.SocketAddressgetSourceAddress()Gets the local address information of this endpoint.intgetSourcePort()Gets the local port information of this endpoint.booleanisBound()Checks if is this endpoint is bound to a address.booleanisClosed()Checks if is this endpoint is closed.
-
-
-
Method Detail
-
accept
public C accept() throws java.io.IOException, java.lang.InterruptedException
Initiates the accept and waits for connect request.- Returns:
- accepted RdmaEndpoint
- Throws:
java.io.IOException- If an I/O error occursjava.lang.InterruptedException- If accept is interrupted
-
bind
public RdmaServerEndpoint<C> bind(java.net.SocketAddress srcAddress, int backlog) throws java.io.IOException
Bind this server endpoint to a specific IP address / port.- Parameters:
srcAddress- the sourcebacklog- the backlog- Returns:
- the rdma server endpoint
- Throws:
java.io.IOException- If binding to local address failed.
-
close
public void close() throws java.io.IOExceptionClose this endpoint. Destroy the Queue Pair (QP).- Throws:
java.io.IOException- If an I/O error occurs
-
getConnectionId
public ConnectionId getConnectionId()
Gets the ConnectionId for this endpoint.- Returns:
- the ConnectionId.
-
getSourceAddress
public java.net.SocketAddress getSourceAddress() throws java.io.IOExceptionGets the local address information of this endpoint.- Returns:
- the local socket address.
- Throws:
java.io.IOException- If an I/O error occurs
-
getSourcePort
public int getSourcePort() throws java.io.IOExceptionGets the local port information of this endpoint.- Returns:
- the local port.
- Throws:
java.io.IOException- If an I/O error occurs
-
isBound
public boolean isBound()
Checks if is this endpoint is bound to a address.- Returns:
- true, if is bound
-
isClosed
public boolean isClosed()
Checks if is this endpoint is closed.- Returns:
- true, if is closed
-
-