Skip to content

Instantly share code, notes, and snippets.

@Tsiannian
Tsiannian / ccb_helper.h
Last active January 4, 2016 11:19
a template helper to create ccb class loader
template <typename T> class Template_creator
{
public:
static T* create(){
T* ptr = new T();
if(ptr != nullptr && ptr->init()){
ptr->autorelease();
return ptr;
}
CC_SAFE_DELETE(ptr);
@Tsiannian
Tsiannian / echo.go
Last active January 2, 2018 10:26
a simple golang echo server.
package main
import (
"bufio"
"fmt"
"log"
"net"
)
func handleConnection(conn net.Conn) {
@Tsiannian
Tsiannian / client.go
Created August 19, 2016 08:44
a go client to check the echo server limit.
package main
import (
"bufio"
"encoding/binary"
"fmt"
"net"
"os"
"time"
)