New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

udprecorder

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

udprecorder

Record and replay UDP streams

0.1.5
PyPI
Maintainers
1

UDPRecorder

UDPRecorder is a Python library for recording and replaying UDP steams. It is made to ease the development of applications based on UDP streams. It is originally used to replay telemetry data from sim racing games such as Assetto Corsa Competizione or F1 20XX games.

Installation

Use the package manager pip to install UDPRecorder.

pip install udprecorder

Usage

Commandline

record_udp -p 1234 -s 127.0.0.1 -f myfile.bin -b 1024 -c 9999 -s 3600
replay_udp -p 1234 -s 127.0.0.1 -f myfile.bin
descriptionrequiredtypedefault
-p--portPort to listen/replay toFalseint1234
-s--serverHost to listen/replay toFalsestr127.0.0.1
-f--fileFile to save/read the streamFalsestrudp.bin
-b--bufferBuffer size limitFalseint65536
-c--countnumber of message to readFalseint1000000000
-t--timetime limit to recordFalseint1000000000

In scripts

import udprecorder

# To record a stream
udprecorder.record(
    file_name = 'my_record.bin', # path to the saved replay
    addr = ('127.0.0.1', 1234)   # (host, port) to listen to
    buffer_size = 65536     # size of buffer used for the socket
    max_num_packets = 1200  # stop the record after 1200 event received
    max_seconds = 3600      # stop the record after 1 hour
)

# To replay a stream
udprecorder.replay(
    file_name = 'my_record.bin', # path to the saved replay
    addr = ('127.0.0.1', 1234)   # (host, port) to emit to
)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. A list of future changes is available just below. Feel free to contribute on those points.

Please make sure to update tests as appropriate.

Future updates

  • Add parameter to adjust the replay speed
  • better handling of errors
  • Add pipeline for tests / pre-commits
  • Add badges on the readme based on build
  • Add tox to tests multiples environments

License

MIT

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts