Exemplo n.º 1
0
        //public RSAParameters PublicParameters;

        /// <summary>
        /// Konstruktor socketa clienta
        /// </summary>
        /// <param name="ip">IPAddress</param>
        /// <param name="port">Port</param>
        public ClientSocket(string ip, int port)
        {
            IPAddress  ipAddress     = IPAddress.Parse(ip);
            IPEndPoint localEndPoint = new IPEndPoint(ipAddress, port);

            clientSocket = new Socket(ipAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
            clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            clientSocket.Bind(localEndPoint);

            sign     = new SignProgram();
            protocol = new Protocol();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Konstruktor socketa clienta
        /// </summary>
        /// <param name="ip">IPAddress</param>
        /// <param name="port">Port</param>
        public ClientSocket(string ip, int port)
        {
            IPAddress  ipAddress     = IPAddress.Parse(ip);
            IPEndPoint localEndPoint = new IPEndPoint(ipAddress, port);

            clientSocket = new Socket(ipAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
            clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            clientSocket.Bind(localEndPoint);

            //uwierzytelnianie
            sign = new SignProgram();
            //diffle hellman
            protocol = new Protocol();
            //aes
            aes = new AESProgram();
        }