Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# coding=utf-8
# Author: Saúl Ibarra Corretgé <[email protected]>
# License: MIT
import argparse
import multiprocessing
import requests
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <uv.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <uv.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
# wait for end
while True:
peer_a_read = asyncio.async(peerA.read())
peer_a_read.other_peer = peerB
peer_b_read = asyncio.async(peerB.read())
peer_b_read.other_peer = peerA
done, pending = yield from asyncio.wait([peer_a_read, peer_b_read], return_when=asyncio.FIRST_COMPLETED)
for task in pending:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "glibuv.h"
typedef struct uv_source_s uv_source_t;
# On a aDebian system
sudo apt-get install ubuntu-archive-keyring
# Create environment
sudo pbuilder create --distribution trusty --architecture amd64 --mirror http://archive.ubuntu.com/ubuntu --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg
# Enable universe
sudo pbuilder update --components "main universe" --override-config --distribution trusty --architecture amd64 --mirror http://archive.ubuntu.com/ubuntu --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg
diff --git a/src/win/tcp.c b/src/win/tcp.c
index c5ddbed..e00dd03 100644
--- a/src/win/tcp.c
+++ b/src/win/tcp.c
@@ -869,7 +869,12 @@ int uv_tcp_write(uv_loop_t* loop,
}
} else {
/* Send failed due to an error. */
- return WSAGetLastError();
+ req->queued_bytes = 0;
Index: jni/opus/pj_sources/pj_opus.c
===================================================================
--- jni/opus/pj_sources/pj_opus.c (revision 2470)
+++ jni/opus/pj_sources/pj_opus.c (working copy)
@@ -666,7 +666,7 @@
unsigned char toc;
const unsigned char *raw_frames[48];
short size[48];
- int payload_offset, samples_per_frame;
+ int err, payload_offset, samples_per_frame;
Index: jni/opus/pj_sources/pj_opus.c
===================================================================
--- jni/opus/pj_sources/pj_opus.c (revision 2470)
+++ jni/opus/pj_sources/pj_opus.c (working copy)
@@ -666,7 +666,7 @@
unsigned char toc;
const unsigned char *raw_frames[48];
short size[48];
- int payload_offset, samples_per_frame;
+ int err, payload_offset, samples_per_frame;
commit ad54c691cf50d0ac396dffccc714699c2b0f3ef0
Author: Saúl Ibarra Corretgé <[email protected]>
Date: Thu Apr 30 11:15:09 2015 +0200
windows: defer reporting TCP write failure until next tick
diff --git a/src/win/tcp.c b/src/win/tcp.c
index 645a3e0..8b0e18c 100644
--- a/src/win/tcp.c
+++ b/src/win/tcp.c