Skip to content

Instantly share code, notes, and snippets.

//
// main.cpp
// OxAsio
//
// Created by sukinull on 1/8/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// based on code, here - http://thisthread.blogspot.tw/2011/04/multithreading-with-asio.html
// you need C++11, and C++11 enabled boost
#include <boost/bind.hpp>
#include "EventBus.h"
std::hash<std::string> Event::key;
void EventBus::Init()
{
is_io_running = true;
m_work.reset(new boost::asio::io_service::work(io_service));
//
// Require libuv v0.11
//
// Created by sukinull on 1/8/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
//
//
// Created by sukinull on 1/8/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// READ: http://nikhilm.github.io/uvbook/basics.html
#include <stdio.h>
#include <uv.h>
//
// Require libuv v0.10
// uv_fs_event_init() parameters changed after v0.11
//
// Created by sukinull on 1/8/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <uv.h>
#define FIB_UNTIL 25
uv_loop_t *loop;
long fib_(long t) {
//
// Created by sukinull on 2/14/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// Simplest libwebsocks example
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
//
// Created by sukinull on 2/14/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// Simplest websocks example using nopoll - http://www.aspl.es/nopoll/
// remark nopoll_conn_set_sock_block (session, nopoll_false); in nopoll_conn_sock_connect under OS X
// use nopoll_conn_set_sock_block to set sock non-block after connect
//
#include <stdio.h>
//
// Created by sukinull on 2/14/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// based on nopoll_pure.c - https://gist.github.com/sukinull/9327937#file-nopoll_pure-c
// add callback function for receive
//
#include <stdio.h>
#include <nopoll.h>
//
// Created by sukinull on 2/14/14.
// Copyright (c) 2014 sukinull. All rights reserved.
//
// With libuv
//
// based on nopoll_w_cb.c - https://gist.github.com/sukinull/9328010#file-nopoll_w_cb-c
// and integrated with libuv
//