using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;

namespace PlantBox.Shared.Communication
{
    /// <summary>
    /// Contains all informations used to communicate
    /// </summary>
    public static class Connection
    {
        // UDP
        /// <summary>
        /// Port used by broadcast discovery
        /// </summary>
        public const int UDP_PORT = 1401;
        /// <summary>
        /// Request sent for a discovery
        /// </summary>
        public static readonly byte[] UDP_REQUEST = { 102, 210, 48, 255 };
        /// <summary>
        /// Reply sent for a discovery
        /// </summary>
        public static readonly byte[] UDP_REPLY = { 102, 210, 48, 0 };

        // TCP
        /// <summary>
        /// Port used by the broker to accept servers
        /// </summary>
        public const int TCP_SERVER_PORT = 1402;
        /// <summary>
        /// Port used by the broker to accept clients
        /// </summary>
        public const int TCP_CLIENT_PORT = 1403;

        /// <summary>
        /// Bytes to read at a time in a <see cref="NetworkStream"/>
        /// </summary>
        public const int BUFFER_SIZE = 4096;
    }
}
