This file contains hidden or 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
#include <stdio.h> | |
#include <assert.h> | |
#include <stdint.h> | |
#include "lua.h" | |
#include "lauxlib.h" | |
inline int | |
_bytes(uint8_t c) { | |
if(c < 0x80) return 1; |
This file contains hidden or 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
import gevent | |
from gevent.queue import Queue | |
q = Queue() | |
session = {} | |
def producer(): | |
i = 1 | |
while True: | |
q.put(i) |
This file contains hidden or 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
function test1(co2) | |
print(12) | |
coroutine.resume(co2) | |
print(34) | |
coroutine.resume(co2) | |
end | |
function test2() | |
print(56) |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import gevent | |
from gevent import monkey;monkey.patch_all() | |
import sys, argparse, socket, time | |
def ping(sock, requests): | |
fileobj = sock.makefile() | |
for i in xrange(requests): | |
sock.sendall("PING\r\n") |
NewerOlder