Add queue buffers & simulation support to web proxy

This makes a couple of major changes:
-Directly uses EPoll class for managing Seasocks events.
-Adds buffers of queues to web proxy Subscribers so that we can
 transfering data losslessly in log replay.
-Modifies the flatbuffer used for the RTC communications so that
 the webpage can specify whether it wants every message or subsampled
 messages.
-Adds an option to LogReader to let us run past the end of the logfile.

Note that these changes do mean that, for log replay, the web proxy will
load the *entire* logfile into memory. Future changes can optimize this
to, e.g., only load the required channels into memory.

Change-Id: I74e7608c30baa8b36e05c4ab50e12a54bf75aa4c
diff --git a/y2020/www/image_handler.ts b/y2020/www/image_handler.ts
index 121ab75..79ce74e 100644
--- a/y2020/www/image_handler.ts
+++ b/y2020/www/image_handler.ts
@@ -1,18 +1,20 @@
 import * as configuration from 'org_frc971/aos/configuration_generated';
-import * as connect from 'org_frc971/aos/network/connect_generated';
 import {Connection} from 'org_frc971/aos/network/www/proxy';
 import * as flatbuffers_builder from 'org_frc971/external/com_github_google_flatbuffers/ts/builder';
 import {ByteBuffer} from 'org_frc971/external/com_github_google_flatbuffers/ts/byte-buffer';
 import {Long} from 'org_frc971/external/com_github_google_flatbuffers/ts/long';
 import * as sift from 'org_frc971/y2020/vision/sift/sift_generated'
 import * as vision from 'org_frc971/y2020/vision/vision_generated';
+import * as web_proxy from 'org_frc971/aos/network/web_proxy_generated';
 
 import Channel = configuration.aos.Channel;
 import Configuration = configuration.aos.Configuration;
-import Connect = connect.aos.message_bridge.Connect;
 import CameraImage = vision.frc971.vision.CameraImage;
 import ImageMatchResult = sift.frc971.vision.sift.ImageMatchResult;
 import Feature = sift.frc971.vision.sift.Feature;
+import SubscriberRequest = web_proxy.aos.web_proxy.SubscriberRequest;
+import ChannelRequest = web_proxy.aos.web_proxy.ChannelRequest;
+import TransferMethod = web_proxy.aos.web_proxy.TransferMethod;
 
 /*
  * All the messages that are required to show an image with metadata.
@@ -106,14 +108,17 @@
       Channel.addName(builder, nameFb);
       Channel.addType(builder, typeFb);
       const channelFb = Channel.endChannel(builder);
-      channels.push(channelFb);
+      ChannelRequest.startChannelRequest(builder);
+      ChannelRequest.addChannel(builder, channelFb);
+      ChannelRequest.addMethod(builder, TransferMethod.SUBSAMPLE);
+      channels.push(ChannelRequest.endChannelRequest(builder));
     }
 
     const channelsFb =
-        Connect.createChannelsToTransferVector(builder, channels);
-    Connect.startConnect(builder);
-    Connect.addChannelsToTransfer(builder, channelsFb);
-    const connect = Connect.endConnect(builder);
+        SubscriberRequest.createChannelsToTransferVector(builder, channels);
+    SubscriberRequest.startSubscriberRequest(builder);
+    SubscriberRequest.addChannelsToTransfer(builder, channelsFb);
+    const connect = SubscriberRequest.endSubscriberRequest(builder);
     builder.finish(connect);
     this.connection.sendConnectMessage(builder);
   }