Skip to content

Instantly share code, notes, and snippets.

View piscisaureus's full-sized avatar
🦕

Bert Belder piscisaureus

🦕
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>
Debug</Configuration>
<Platform>
Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
uv_shutdown_t: 88 bytes
uv_write_t: 88 bytes
uv_connect_t: 88 bytes
uv_tcp_t: 544 bytes
uv_pipe_t: 536 bytes
uv_prepare_t: 72 bytes
uv_check_t: 72 bytes
uv_idle_t: 72 bytes
uv_async_t: 136 bytes
From 91bb98696abd65117adf5b4bb25ec12eac160c0c Mon Sep 17 00:00:00 2001
From: Bert Belder <[email protected]>
Date: Wed, 10 Aug 2011 03:21:17 +0200
Subject: [PATCH 1/1] GetQueuedCompletionStatusEx experiment
---
config-mingw.mk | 2 +-
include/uv-win.h | 2 +-
src/win/core.c | 53 ++++++++++++++++++++++++++++++++++++++---------------
3 files changed, 40 insertions(+), 17 deletions(-)
From c9f1146f99b67c2b8354c2ed9a47808fb85a30b1 Mon Sep 17 00:00:00 2001
From: Bert Belder <[email protected]>
Date: Thu, 11 Aug 2011 04:00:39 +0200
Subject: [PATCH 1/2] Windows: fix pipe shutdown
---
src/win/pipe.c | 91 +++++++++++++++++++++++++++++++++++++++----------------
src/win/req.c | 7 ++++
2 files changed, 71 insertions(+), 27 deletions(-)
uv_shutdown_t: 16 bytes
uv_write_t: 68 bytes
uv_connect_t: 24 bytes
uv_tcp_t: 152 bytes
uv_pipe_t: 156 bytes
uv_prepare_t: 64 bytes
uv_check_t: 64 bytes
uv_idle_t: 64 bytes
uv_async_t: 68 bytes
uv_timer_t: 80 bytes
Dealing with stdio
1. figure out the type of stdio handle
2. use it
* Windows
+ console handle -> ReadConsoleInput / WriteConsoleOutput. Captures keystrokes.
+ (blocking) named pipe -> ReadFile / WriteFile in a thread.
+ (blocking) file handle -> ReadFile / WriteFile in a thread.
+ (overlapped) named pipe server handle -> Igor's patch
+ other options not considered so far: socket, tcp server, overlapped file, overlapped
volatile int uv_initialized = 0;
volatile HANDLE uv_init_event = NULL;
void uv_init() {
HANDLE event, event2;
DWORD result;
if (!uv_initialized) {
event = CreateEvent(NULL, 1, 0, NULL);
Bert: hey, here?
ryah: yes
Bert: why are you setting SO_REUSEADDR on sockets?
ryah: i've heard it's good
ryah: :)
Bert: aha
ryah: well, for servers it's nice
ryah: for clients it's more doubtful
ryah: i haven't actually tested to see if they can reuse the ephemeral ports more quickly
ryah: but htat's what ive been told
From 99e99ac89110edf5614a326096f41ed1c24f8650 Mon Sep 17 00:00:00 2001
From: Bert Belder <[email protected]>
Date: Fri, 26 Aug 2011 01:32:27 +0200
Subject: [PATCH 1/1] win: better shutdown for pipes
---
include/uv-win.h | 3 +-
src/win/pipe.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 176 insertions(+), 27 deletions(-)
@piscisaureus
piscisaureus / out2
Created September 2, 2011 23:59 — forked from anonymous/out2
['-f', 'msvs', '-G', 'msvs_version=2010', '.\\node.gyp', '-I', '.\\common.gypi', '--depth=.', '-Dtarget_arch=ia32', '-Dcomponent=static_library', '-Dlibrary=static_library']
Project files generated.
http_parser.vcxproj -> D:\nodejs\node3\Debug\http_parser.lib
openssl.vcxproj -> D:\nodejs\node3\Debug\openssl.lib
uv.vcxproj -> D:\nodejs\node3\Debug\uv.lib
v8_base.vcxproj -> D:\nodejs\node3\Debug\v8_base.lib
v8_nosnapshot.vcxproj -> D:\nodejs\node3\Debug\v8_nosnapshot.lib
v8_snapshot.vcxproj -> D:\nodejs\node3\Debug\v8_snapshot.lib
running 'python tools/test.py --mode=debug'