Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Difficulties integrating into an existing application #20

@tech10

Description

@tech10

There will be some difficulties with integration of this library into another application.

At the moment, it is written in such a way that the library is strictly used for creating a TCP server only. However, I could see instances where one might desire to integrate this library into another application. There are some problems with its current implementation.

  • The library implements its own logging, and will shut down the entire program if an error is received that prevents the server from starting. Some programs might want to log data and shut down themselves in a clean, controlled manner. This library prevents this from occurring properly.
  • There is no way to stop a server once it's started. If a program integrating this library is intercepting process signals, or is otherwise being shut down through another means, the server won't close cleanly in a controlled manner that will stop accepting connections, clients, disconnect all clients, and terminate all running goroutines the server has spawned. The server will remain active and the goroutine to accept connections, at the very least, will still be operational.

Changes to the server might create some breaking changes to clients relying on it for use, such as if they expect the server to stop the program if it can't initialize, something that isn't wise programming. All go programs should handle errors in a controlled manner.

I would propose these issues at the minimum be addressed, so as to allow for integration of this library into existing applications, as well as to allow for the program to log its own errors properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions