This file contains hidden or 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
/* OUTPUT | |
tick tock | |
I'm the second handler of the tick event | |
I'm on the dispatcher thread | |
I'm on a thread pool thread | |
I just got value 42 sent to me and I'm on the dispatcher loop thread | |
I'm on a thread pool thread and shutting down dispatcher safely | |
exiting... |
This file contains hidden or 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
/* | |
OUTPUT | |
initial thread id - 15684 | |
thread id - 15684 | |
got ip address - 74.125.224.165 | |
connected ! | |
*/ | |
int _tmain(int argc, _TCHAR* argv[]) |
This file contains hidden or 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
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
cout << "initial thread id - " << this_thread::get_id() << endl; | |
/* dns resolver */ | |
auto dns = net::dns(); | |
/* socket client */ | |
auto socket = net::stream_socket(); |
This file contains hidden or 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
int main() | |
{ | |
Modern::Initialize(); | |
Uri uri(L"http://moderncpp.com/about/"); | |
auto socket = Modern::Windows::Networking::Sockets::StreamSocket(); | |
printf("port: %d\n", uri.Port()); |
This file contains hidden or 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 "Precompiled.h" | |
#include <stdio.h> | |
#include <ppltasks.h> | |
#include <iostream> | |
#include <string> | |
using namespace Modern::Windows::Foundation; | |
using namespace Modern::Windows::Networking::Connectivity; | |
using namespace Modern::Windows::Networking; | |
using namespace Modern::Windows::Networking::Sockets; |
This file contains hidden or 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 "details/_uv_async.hpp" | |
#include "details/_uv_loop.hpp" | |
#include "details/_utilities.hpp" | |
#include "details/_uv_work.hpp" | |
namespace uvxx { namespace details | |
{ | |
_uv_loop::_uv_loop(bool use_default /*= false*/) : | |
__uv_loop_(use_default ? uv_default_loop() : uv_loop_new()), | |
/* uv_async_init */ |
This file contains hidden or 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
#pragma once | |
#include <memory> | |
#include <chrono> | |
#include <atomic> | |
#include <vector> | |
#include <mutex> | |
#include <functional> | |
#include <type_traits> | |
#include "pplxtasks.h" | |
#include <event_dispatcher_timer.hpp> |
This file contains hidden or 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
int read_pass_counter = 0; | |
uint64_t total_bytes_read = 0; | |
string host_name = "10.1.30.151"; | |
int host_port = 80; | |
string http_command = "GET /movie.mp4 HTTP/1.0\r\n\r\n"; | |
void test_method() |
This file contains hidden or 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
/////VS 2013 ///// | |
////////////////// | |
#include "stdafx.h" | |
#include <assert.h> | |
#include <thread> | |
#define __thread_local __declspec(thread) | |
const int some_int = 5; |
This file contains hidden or 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
// ConsoleApplication1.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <stdint.h> | |
#include <vector> | |
#include <algorithm> | |
#include <filesystem> | |
#include <random> |
OlderNewer