com.neeve.link
Interface ILnkServerEndpointCore

All Known Implementing Classes:
LnkLclServerEndpoint, LnkMultiServerEndpoint, LnkNwServerEndpoint

public interface ILnkServerEndpointCore

The Link Server Endpoint Core interface.

The LnkServerEndpoint class implements the ILnkServerEndpoint interface. Internally, the implementation consists of a portion that is common to all server endpoint implementations and a portion that is link type specific. This interface is a subset of ILnkServerEndpoint, is intended to be implemented by link type specific server endpoint implementations and is used by LnkServerEndpoint (referred to as the 'user' in the method documentation below) to carry out link type specific operations. Generally, the creation of a server endpoint first instantiates the type specific server endpoint followed by wrapping an instance of LnkServerEndpoint around the instantiated type specific endpoint to generate a full implementation of ILnkServerEndpoint that is returned to the user.

This interface is not directly accessed by an end user of a server endpoint. It is intended for use by link type specific server endpoint implementers that use LnkServerEndpoint in their implementation.

Threading:
A link type specific server endpoint implementation is not safe for concurrent access by multiple threads i.e. the different threads cannot be invoked concurrently by different threads. Refer to the method documentation for information regarding the threading and concurrency models for each of the methods.

Method Summary
 void acceptCancel(int flags)
          Cancel a previously posted accept.
 void acceptPost(IEmxDispatcher dispatcher, ILnkEventHandlerCore handler, int flags)
          Post an accept of an incoming connection request.
 void close()
          Close a server endpoint.
 

Method Detail

acceptPost

void acceptPost(IEmxDispatcher dispatcher,
                ILnkEventHandlerCore handler,
                int flags)
                throws ELnkOpFailedException
Post an accept of an incoming connection request.

Parameters:
dispatcher - The dispatcher in whose context the completion event is to be dispatched. The user will ensure that the the invoking thread is the owner of this dispatcher.
handler - The event handler to which the completion event is to be dispatched.
flags - Flags that qualify the accept operation. The following flags can be set on invocation of this method:
- ILnkEndpoint.IOFLAG_NO_ASYNC: In case this flag is specified and the accept operation could not be completed prior to return from this call, the method should not schedule the accept for asynchronous completion and just return without throwing any exception.
Throws:
ELnkOpFailedException - This exception should be thrown in case a failure was encountered in accepting or initiating the background accept of incoming connections.

This method should accept an incoming link connection request. The result of the connection acceptance should be notified through the dispatch of the LnkEvents.EVENT_CONNECT_COMPLETE event to the provided event handler. It is permissible to dispatch the completion event prior to returning from this method in case the accept could be completed synchronously with success. In the event that the completion event was not dispatched prior to return from this method and the method does not throw an exception, the caller will drive the supplied dispatcher until the completion event is dispatched or the accept is cancelled.

The caller will ensure the following prior to invoking this method:
- Parameter integrity including calling thread validity
- State integrity i.e. this method will never be invoked on a closed endpoint or at any point while a background accept is in progress.

The execution of this method can be qualified through the specification of certain flags in the flags parameter. Refer to flags parameter documentation for the list of permissible flags and for a description of how those flags should qualify the behaviour of this method.

See Also:
acceptCancel(int)
Threading:
This method is never invoked concurrently with any other thread and will always be the owner thread of the provided dispatcher.

acceptCancel

void acceptCancel(int flags)
Cancel a previously posted accept.

Parameters:
flags - Flags that qualify the accept cancellation operation. Currently, there are no supported flags for use. This parameter is present for future use. The user will always specify a value of 0 in this parameter.

This method should cancel a previously posted accept operation. A successful return from this method indicates that the accept operation has been cancelled. No completion event for the accept should be dispatched once the accept has been cancelled.

See Also:
acceptPost(com.neeve.emx.IEmxDispatcher, com.neeve.link.ILnkEventHandlerCore, int)
Threading:
This method is never invoked concurrently with any other thread and will always be the owner thread of the provided dispatcher.

close

void close()
           throws ELnkOpFailedException
Close a server endpoint.

Throws:
ELnkOpFailedException - This exception should be thrown in case an error was encountered while closing the endpoint.

This method is used to close a server endpoint and release all underlying system resources allocated to the server endpoint. This method will never be invoked on an endpoint on which an accept is pending.

Threading:
This method is never invoked concurrently with any other thread.


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.