Add methods to get the hostname and network interfaces.

This commit is contained in:
Peter Johnson
2016-11-18 11:44:25 -08:00
parent e1f4e3d2d7
commit 5fecc57e8a
7 changed files with 103 additions and 0 deletions

View File

@@ -2,7 +2,13 @@
#include <stdio.h>
#include "llvm/raw_ostream.h"
int main() {
llvm::outs() << "hostname: " << cs::GetHostname() << '\n';
llvm::outs() << "IPv4 network addresses:\n";
for (const auto& addr : cs::GetNetworkInterfaces())
llvm::outs() << " " << addr << '\n';
cs::USBCamera camera{"usbcam", 1};
camera.SetVideoMode(cs::VideoMode::kMJPEG, 320, 240, 30);
cs::MJPEGServer mjpegServer{"httpserver", 8081};