This file contains 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 <iostream> | |
#include "linear/ws_server.h" | |
namespace app { | |
class Handler : public linear::Handler { | |
void OnMessage(const linear::Socket& socket, const linear::Message& message) { | |
switch (message.type) { | |
case linear::Request: | |
linear::Request request = message.as<linear::Request>(); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>echo client</title> | |
<script type="text/javascript" src="./jquery.min.js"></script> | |
<script type="text/javascript" src="./linear.debug.js"></script> | |
<script type="text/javascript"> | |
var c; | |
window.onload = function() { |
This file contains 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
<!-- | |
$ git clone --recursive https://github.com/linear-rpc/linear-js /path/to | |
$ cp /path/to/linear-js/src/linear.min.js . | |
$ cp /this/index.html ./index.html | |
$ open ./index.html # with browser | |
==> check developer console | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> |
This file contains 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
/** | |
* $ git clone --recursive https://github.com/linaer-rpc/linear-cpp /path/to | |
* $ cd /path/to/linear-cpp | |
* $ ./bootstrap && ./configure && make | |
* $ cp /this/foo.cpp /path/to/linear-cpp/sample | |
* $ cd sample | |
* $ g++ -I ../include -I ../deps/msgpack/include -o foo foo.cpp ../src/.libs/liblinear.a ../deps/libtv/src/.libs/libtv.a ../deps/libtv/deps/libuv/.libs/libuv.a | |
* $ ./foo | |
*/ |
This file contains 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
// NOTE: linear-cpp/include/any.h, binary.h, optional.h are header only. | |
// $ git clone --recursive https://github.com/linear-rpc/linear-cpp | |
// $ clang++ msgpack_bin.cpp -I linear-cpp/deps/msgpack/include -I linear-cpp/include -std=c++11 | |
// $ ./a.out fname # create a msgpack binary file | |
// $ cat fname | ./a.out # dump it | |
#include <fstream> | |
#include <iostream> |