Skip to content

feat: WebsocketServer does not expose OcppWampServer.shutdown() #105

Open

Description

@juherr

OcppWampServer documents a graceful shutdown:

/**
 * attempt a graceful shutdown of the server:
 * - do not accept connection any more
 * - do not accept new calls any more
 * - close opened connections when pending calls are done
 */
fun shutdown()

WebsocketServer holds an OcppWampServer but exposes no shutdown(), and ServerTransport does
not declare one either. Stopping the underlying Http4kServer drops connections instead of draining
them, so a CSMS on this transport cannot shut down without cutting in-flight OCPP calls.

This is the same shape of gap as the settings parameter fixed in #101: the capability exists one
layer down and is simply not reachable through the transport.

Two questions to settle:

  • expose shutdown() on WebsocketServer only, or add it to the ServerTransport interface so
    CSMS.stop() can drain every transport before stopping the HTTP servers? The latter is the useful
    version but means OcppSoapServerTransport needs an answer too (possibly a no-op).
  • adding a method to ServerTransport is a breaking change for any external implementor; a default
    implementation would avoid that.

Raised by @pbourseau in review of #101.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions