Skip to content

Instantly share code, notes, and snippets.

@pyos
pyos / cno.h
Last active July 3, 2018 12:51
libcno and coroutine-based echo server
#pragma once
#include "cone.h"
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <memory>
@pyos
pyos / ping.py
Last active November 16, 2021 15:31
import time
import random
import struct
import select
import socket
def chk(data):
x = sum(x << 8 if i % 2 else x for i, x in enumerate(data)) & 0xFFFFFFFF
x = (x >> 16) + (x & 0xFFFF)