Skip to content

Instantly share code, notes, and snippets.

View jasonknight's full-sized avatar

Jason Martin jasonknight

View GitHub Profile
@hongster
hongster / tcp_timeout.go
Created October 2, 2015 11:30
Golang example on handling TCP connection and setting timeout.
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
@mojocorp
mojocorp / winmain.cpp
Last active March 1, 2018 22:30
Windows winmain argc argv console application
#ifdef _WIN32
#include <windows.h>
#include <stdio.h>
#pragma warning(disable: 4996)
extern int main(int argc, char* argv[]);
int WINAPI WinMain(HINSTANCE /*hInstance*/,
HINSTANCE /*hPrevInstance*/,