Skip to content

Instantly share code, notes, and snippets.

View newmind's full-sized avatar
🎯
Focusing

JG newmind

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<tables>
<row>
<cols>
<col name="Metric" href="http://google.com/">Disti Quoting</col>
<col name="Error Count" href="http://naver.com.com/">95</col>
<col name="_IW_COLOR">RED</col>
<col name="_IW_ICON_BLINK">yes</col>
</cols>
</row>
#-*- coding: utf-8 -*-
"""
The SocketServer module does not provide support for multicast. This module
provides a subclass of SocketServer.UDPServer that can listen on multicast
addresses.
This only supports IPv4
"""
#-*- coding: utf-8 -*-
#
# windows 에서 multicast join 상태 보는법
# netsh interface ip show joins
# linux 에서 multicast join 상태 보는법
# netstat -g
import socket
import struct
#-*- coding: utf-8 -*-
import socket
MCAST_GRP = '225.0.0.1'
MCAST_GRP2 = '226.0.0.1'
MCAST_GRP3 = '227.0.0.1'
MCAST_PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
@newmind
newmind / udp_send.py
Created September 30, 2015 04:56 — forked from jgkim77/udp_send.py
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 5005
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
@newmind
newmind / udp_recv.py
Created September 30, 2015 04:56 — forked from jgkim77/udp_recv.py
import socket
MIN_BUFF_SIZE = 8192
UDP_IP = "192.168.200.72"
UDP_PORT = 5005
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
import socket
MAX_BUFF_SIZE = 0x7FFFFFFF
MIN_BUFF_SIZE = 0
def checkSocketBuffer():
reportDict = {}
# check TCP Buffer
checkTcpSocketBuffer(reportDict)
@newmind
newmind / gevent_svr_setup.py
Created September 30, 2015 04:56 — forked from jgkim77/gevent_svr_setup.py
gevent_svr to exe
#-*- coding: utf-8 -*-
#
# python gevent_svr_setup.py py2exe
# 참조. http://www.dreamy.pe.kr/zbxe/CodeClip/15123
from distutils.core import setup
import py2exe
setup(
options = {"py2exe": {"packages": ["encodings"],
@newmind
newmind / gevent_wsgi.py
Created September 30, 2015 04:56 — forked from jgkim77/gevent_wsgi.py
gevent SCGIServer
#-*- coding: utf-8 -*-
# 참조 http://nichol.as/benchmark-of-python-web-servers
# http://blindvic.blogspot.it/2013/04/hello-world-gevent-vs-nodejs.html
#
# 테스트 방법
# ab -n 100000 -c 5 http://localhost:8888/
# (http://blindvic.blogspot.it/2013/04/hello-world-gevent-vs-nodejs.html)
from gevent import wsgi
@newmind
newmind / gevent_svr.py
Created September 30, 2015 04:56 — forked from jgkim77/gevent_svr.py
gevent StreamServer
#-*- coding: utf-8 -*-
# 참조 http://mauveweb.co.uk/posts/2014/07/gevent-asynchronous-io-made-easy.html
# 테스트 방법
# ab -n 100000 -c 5 http://localhost:8888/
# (http://blindvic.blogspot.it/2013/04/hello-world-gevent-vs-nodejs.html)
import sys
from gevent.server import StreamServer
from gevent.server import _tcp_listener
#from gevent.monkey import patch_all; patch_all()