RustではTCP/IP通信を利用するためにいくつかの組み込みオブジェクトが用意されています。この章では簡単なTCP/IPアプリケーションを実装する上での基本的な方法を説明します。
まずTCP/IPアプリケーションを作成するにはいくつかの方法があります。
- rust標準のstd::rt::io::netパッケージを利用する
- rustで利用されるlibvuをffi経由で利用する
- OS標準のライブラリwinsocketやBSD socketをffi経由で利用する
#include <olectl.h> | |
#include <sensorsapi.h> | |
#include <sensors.h> | |
#include <stdio.h> | |
#pragma comment(lib, "sensorsapi.lib") | |
#pragma comment(lib, "PortableDeviceGUIDs.lib") | |
#pragma comment(lib, "ole32.lib") | |
#pragma comment(lib, "user32.lib") |
#include <dwrite.h> | |
#include <dwrite_2.h> | |
#include <stdio.h> | |
#pragma comment(lib, "dwrite.lib") | |
int main() | |
{ | |
HRESULT hr; | |
IDWriteFactory* dwriteFactory; |
void DrawGlyphRun(ID2D1RenderTarget* target, IDWriteFactory factory, IDWriteFont* fontFace, ID2D1Brush* defaultBrush, DWRITE_GLYPH_RUN* glyphRun) | |
{ | |
bool isColor = false; | |
IDWriteColorGlyphRunEnumerator* colorLayer; | |
IDWriteFont2* fontFace2; | |
fontFace->QueryInterface(reinterpret_cast<IDWriteFontFace2**>(&fontFace2)); | |
if (fontFace2->IsColorFont()) { | |
IDWriteFactory2* factory2; | |
factory->QueryIntarface(reinterpret_cast<IDWriteFactory2**>(&factory2)); |
<?DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
var crypto = window.crypto; | |
var data = convertStringToArrayBufferView('ABCDEFGHIJKLMNOP'); | |
var vector = crypto.getRandomValues(new Uint8Array(16)); | |
function convertStringToArrayBufferView(str) | |
{ |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#include "xf86drm.h" | |
// gcc -I/usr/include/libdrm/ -ldrm vsync.c | |
int64_t get_time(void) | |
{ |
PYTHONPATH=../python/mozbuild ./update-icu.sh http://source.icu-project.org/repos/icu/trunk/icu4c |
./configure --host=x86_64-pc-mingw32 --build=x86_64-pc-mingw32 --disable-shared --enable-static CC="$(pwd)/msvcc.sh -m64" CPP="cl -nologo -EP" SHELL=sh.exe LD=link |
sudo yum groupinstall "Development Tools" | |
sudo yum install ninja-build | |
wget https://www.mercurial-scm.org/release/mercurial-5.0.1.tar.gz | |
tar xf mercurial-5.0.1.tar.gz | |
cd mercurial-5.0.1.tar.gz | |
make all | |
sudo make install | |
cd .. | |
/usr/local/bin/hg clone https://hg.mozilla.org/projects/nspr |
Actually, we can build GeckoView on WSL and VMs. but since Android Studio runs under Windows, not WSL, if using WSL, you cannot use Android Studio to debug GeckoView. We have limited support to build GV on the mozilla-build environment.
Same as Linux. But,
./mach install
or ./mach run
doesn't work. But this has workaround (see using ADB).adb
(microsoft/WSL#2195)