Ejemplo n.º 1
0
        public void CommunicationsUnitTest()
        {
            using (SessionServer server = new SessionServer(new IPEndPoint(IPAddress.Any, IPEndPoint.MaxPort)))
            {
                server.CommuniqueReceived += new CommuniqueReceivedEventHandler(server_CommuniqueReceived);

                IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
                IPEndPoint clientEndPoint = new IPEndPoint(hostEntry.AddressList[0], IPEndPoint.MaxPort);
                using (SessionClient client = new SessionClient(clientEndPoint))
                {
                    Communique communique = new Communique("CommunicationsUnitTest");
                    client.SendCommunique(communique);
                }

            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sends an update for the specified CachedItem to all configured servers.
 /// </summary>
 /// <param name="client">The SessionClient used to send the update.</param>
 /// <param name="item">The CachedItem to be sent to all configured servers.</param>
 private void SendCommunique(SessionClient client, CachedItem item)
 {
     Communique communique = new Communique(item);
     client.SendCommunique(communique);
 }