Example #1
0
        public void Connect(string address)
        {
            FunapiTcpTransport  tcp_transport  = new FunapiTcpTransport(address, 8022, FunEncoding.kProtobuf);
            FunapiHttpTransport http_transport = new FunapiHttpTransport(address, 8018, false, FunEncoding.kJson);

            network_ = new FunapiNetwork(true);
            network_.AttachTransport(tcp_transport);
            network_.AttachTransport(http_transport);

            network_.RegisterHandlerWithProtocol("pbuf_echo", TransportProtocol.kTcp, this.OnTcpEcho);
            network_.RegisterHandlerWithProtocol("echo", TransportProtocol.kHttp, this.OnHttpEcho);

            network_.Start();
        }
Example #2
0
 // Use this for initialization
 void Start()
 {
     network.Start();
 }