title: Local Client/Server interaction not functioning in Unity
body: <p>I can't seem to get my client to connect to my server. I'm developing a multiplayer game that will be played and hosted on a local area network. I'm trying to setup the preliminary steps to get all network transport functions going but it just doesn't seem to be working. When I run the client as a standalone app and the server in unity editor, i should see feedback in the editor console when the client connects to the server, </p>
  
  <pre><code>case NetworkEventType.ConnectEvent:
                  Debug.Log("Player " + connectionId + "has connected.");
                  OnConnection(connectionId);
  </code></pre>
  
  <p>but I'm not getting any feedback. I'm new at networking so I'm having trouble tracking down where things are going wrong. Any help would be great! thanks.</p>
  
  <p>'NetworkServerController.cs'</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.Networking;
  using System.Text;
  
  public class NetworkServerController : MonoBehaviour {
  
      private const int MAX_CONNECTION = 100;
      private int port = 5701;
  
      private int hostID;
      private int webHostID;
  
      private int reliableChannel;
      private int unreliableChannel;
      private int reliableFragChannel;
      private int unreliableFragChannel;
  
      private bool isStarted = false;
      private byte error;
  
      private void Awake()
      {
          //NetworkServer.Reset();
      }
  
      private void Start()
      {
          NetworkTransport.Init();
          ConnectionConfig cc = new ConnectionConfig();
  
          reliableChannel = cc.AddChannel(QosType.Reliable);
          unreliableChannel = cc.AddChannel(QosType.Unreliable);
          reliableFragChannel = cc.AddChannel(QosType.ReliableFragmented);
          unreliableFragChannel = cc.AddChannel(QosType.UnreliableFragmented);
  
          HostTopology topo = new HostTopology(cc, MAX_CONNECTION);
  
          hostID = NetworkTransport.AddHost(topo, port, null);
          webHostID = NetworkTransport.AddWebsocketHost(topo, port, null);
  
          isStarted = true;
      }
  
      private void Update()
      {
          if (!isStarted)
              return;
  
          int recHostId;
          int connectionId;
          int channelId;
          byte[] recBuffer = new byte[1024];
          int bufferSize = 1024;
          int dataSize;
          byte error;
          NetworkEventType recData = NetworkTransport.Receive(out recHostId, out connectionId, out channelId, recBuffer, bufferSize, out dataSize, out error);
          switch (recData)
          {
              case NetworkEventType.Nothing:         //1
                  break;
              case NetworkEventType.ConnectEvent:    //2
                  Debug.Log("Player " + connectionId + "has connected.");
                  OnConnection(connectionId);
                  break;
              case NetworkEventType.DataEvent:       //3
                  string msg = Encoding.Unicode.GetString(recBuffer, 0, dataSize);
                  Debug.Log("Player " + connectionId + "has sent : " + msg);
                  break;
              case NetworkEventType.DisconnectEvent: //4
                  Debug.Log("Player " + connectionId + "has disconnected.");
                  break;
          }
      }
  
      private void OnConnection(int cnnID)
      {
          // Add to list
  
          // When player joins, tell ID
  
          // Request name and send name of all the other players
      }
  }
  </code></pre>
  
  <p>'NetworkClientController.cs'</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using UnityEngine.Networking;
  
  public class NetworkClientController : MonoBehaviour {
  
      private const int MAX_CONNECTION = 100;
      private int port = 5701;
      private string IPAddress = "localhost";
  
      private int hostID;
      private int webHostID;
  
      private int reliableChannel;
      private int unreliableChannel;
      private int reliableFragChannel;
      private int unreliableFragChannel;
  
      private int connectionID;
  
      private float connectionTime;
      private bool isConnected = false;
      private bool isStarted = false;
      private byte error;
  
      private string playerName;
  
      private void Start()
      {
          Connect();
      }
  
      private void Update()
      {
          if (!isConnected)
              return;
  
          int recHostId;
          int connectionId;
          int channelId;
          byte[] recBuffer = new byte[1024];
          int bufferSize = 1024;
          int dataSize;
          byte error;
          NetworkEventType recData = NetworkTransport.Receive(out recHostId, out connectionId, out channelId, recBuffer, bufferSize, out dataSize, out error);
          switch (recData)
          {
              case NetworkEventType.Nothing:         //1
                  break;
              case NetworkEventType.ConnectEvent:    //2
                  break;
              case NetworkEventType.DataEvent:       //3
                  break;
              case NetworkEventType.DisconnectEvent: //4
                  break;
          }
      }
  
      public void Connect()
      {
          NetworkTransport.Init();
          ConnectionConfig cc = new ConnectionConfig();
  
          reliableChannel = cc.AddChannel(QosType.Reliable);
          unreliableChannel = cc.AddChannel(QosType.Unreliable);
          reliableFragChannel = cc.AddChannel(QosType.ReliableFragmented);
          unreliableFragChannel = cc.AddChannel(QosType.UnreliableFragmented);
  
          HostTopology topo = new HostTopology(cc, MAX_CONNECTION);
  
          hostID = NetworkTransport.AddHost(topo, port, null);
          connectionID = NetworkTransport.Connect(hostID, IPAddress, port, 0, out error);
  
          connectionTime = Time.time;
          isConnected = true;
      }
  }
  </code></pre>