Skip to content

0mq/funcall.py — ZMQ Socket Created/Destroyed Every Loop Iteration #268

@GaneshPatil7517

Description

@GaneshPatil7517

@pradeeban
File: 0mq/funcall.py line ~27-34

while concore2.simtime < concore.maxtime:
    paired_transmitter = PairedTransmitter(...)       # NEW socket every iteration
    paired_transmitter.start_background_sync()         # NEW thread every iteration
    ym = paired_transmitter.request_with_immediate_reply(...)
    paired_transmitter.stop_background_sync()          # DESTROY everything

This creates/destroys ZMQ sockets and threads every single loop cycle. Enormous overhead, and ports may fail to rebind due to OS TIME_WAIT state. The transmitter should be created once outside the loop.

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