Created
February 12, 2019 14:08
-
-
Save wilspi/f68545494eafd57b7a8229ba3359c389 to your computer and use it in GitHub Desktop.
Mock Statsd server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Script to run UDP Server on 127.0.0.1:8126 | |
# This mocks statsd server for testing | |
import socket | |
UDP_IP_ADDRESS = "127.0.0.1" | |
UDP_PORT_NO = 8126 | |
serverSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
serverSock.bind((UDP_IP_ADDRESS, UDP_PORT_NO)) | |
while True: | |
data, addr = serverSock.recvfrom(1024) | |
print "Message: ", data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment