Skip to content

Usage

Aims of the project

PhoenixSocket aims to provide a versatile and efficient socket management library for the Phoenix ecosystem. It simplifies the handling of network communication, enabling seamless integration with other Phoenix libraries. The project focuses on reliability, ease of use, and performance for both scientific and industrial applications.

Key objectives

  • Provide robust socket management for Phoenix applications.
  • Ensure compatibility with various network protocols and standards.
  • Enable easy integration with other Phoenix modules through a consistent API.
  • Offer performance suitable for high-demand scientific and industrial projects.
  • Facilitate maintenance and evolution with comprehensive documentation and unit tests.

Socket Backend

PhoenixSocket provides several backends :

  • PEmptyBackend : an empty backend to start the development of a custom backend for your favorite technology
  • PMockBackend : a mock backend which flushes data when the socket is destroyed. Nice for small tests.
  • PMockBackendFile : a mock backend which flushes data every times the socket is used. Usefull if you want to debug a crash. For this usecase, is the program crashes the mock could be broken and not reusable directly but you can use phoenix_mock_restore from PhoenixMock to restore it inplace with :
phoenix_mock_restore -i your_mock_file.pmocksocket