/// <summary> /// Add a new connector to this client. /// </summary> /// <param name="name">The name of the connector.</param> /// <param name="readBufferSize">The Maximum number of bytes the connector can read at a time.</param> /// <param name="readTimeOut">The maximum time in milliseconds the connector can use to read incoming data.</param> /// <param name="serverIP">The server's ip address the connector will use to send data.</param> /// <param name="serverPort">The server's udp port.</param> /// <returns>The connector.</returns> public UDPConnector AddConnector(string name, int readBufferSize, int readTimeOut, IPAddress serverIP, int serverPort) { UDPConnector connector = new UDPConnector(this, name, readBufferSize, readTimeOut, serverIP, serverPort); fConnectors.Add(connector); return connector; }
public virtual void OnDataReceive(UDPConnector connector, DatagramPacket packet) { //Console.WriteLine("Data received: " + Encoding.Default.GetString(packet.Bytes)); }