Пример #1
0
 public LdpAuthRequestHandler()
 {
     serverHandler    = LdpServer.GetInstance();
     packetFactory    = new LdpProtocolPacketFactory();
     userSettings     = new LdpUserSettings();
     settingsPassword = userSettings.GetPassword;
 }
 public void Dispose()
 {
     serverHandler            = null;
     volumeController         = null;
     packetFactory            = null;
     packetRequest            = null;
     volumeInfoResponse       = null;
     preparableVolumeResponse = null;
 }
Пример #3
0
 public void Dispose()
 {
     authResponse   = null;
     responsePacket = null;
     serverHandler  = null;
     userSettings   = null;
     packetFactory  = null;
     GC.SuppressFinalize(this);
 }
        public LdpRemoteDesktopSender()
        {
            serverHandler = LdpServer.GetInstance();
            serverHandler.GetListenerChannel.AddListener(this);
            mouseController    = new LdpMouseController();
            keyboardController = new LdpKeyboardController();
            commander          = new LdpCommandController();

            packetFactory = new LdpProtocolPacketFactory();
            screenGrabber = new LdpScreenGrabber();
        }
        public LdpRemoteVolumeSender()
        {
            serverHandler = LdpServer.GetInstance();
            packetFactory = new LdpProtocolPacketFactory();
            serverHandler.GetListenerChannel.AddListener(this);

            volumeController         = new LdpVolumeController();
            volumeController.OnMute += volumeController_OnMute;
            volumeController
            .GetDevice
            .AudioEndpointVolume
            .OnVolumeNotification += AudioEndpointVolume_OnVolumeNotification;
        }
        protected void DisconntectClientFromServer()
        {
            if (clientSocket != null && clientSocket.Connected)
            {
                try
                {
                    var factory = new LdpProtocolPacketFactory();
                    var list    = packetListener.GetListenersList;
                    LdpDisconnectRequest disconnectPacket = null;
                    LdpPacket            packet           = null;
                    const int            TIMEOUT          = 100;
                    if (list != null && list.Count != 0)
                    {
                        foreach (var item in list)
                        {
                            if (item is LdpRemoteDesktopSender)
                            {
                                disconnectPacket = factory
                                                   .SetDisconnectRequest(DisconnectionType.FROM_SCREEN_THREAD);
                                packet = factory.BuildPacket(disconnectPacket);
                                packetSender.Send(packet);
                                Thread.Sleep(TIMEOUT);
                                break;
                            }
                            else if (item is LdpRemoteVolumeSender)
                            {
                                disconnectPacket = factory
                                                   .SetDisconnectRequest(DisconnectionType.FROM_VOLUME_THREAD);
                                packet = factory.BuildPacket(disconnectPacket);
                                packetSender.Send(packet);
                                Thread.Sleep(TIMEOUT);
                                break;
                            }
                        }
                    }

                    disconnectPacket = factory
                                       .SetDisconnectRequest(DisconnectionType.FROM_SERVER);
                    packet = factory.BuildPacket(disconnectPacket);
                    packetSender.Send(packet);
                    disconnectPacket = null;
                    packet           = null;
                }
                catch (Exception exc)
                {
                    LdpLog.Error("DisconntectClient error.\n" + exc.Message);
                }
            }
        }
        public void Dispose()
        {
            interruptGrabbing = false;
            serverHandler     = null;
            screenResponse    = null;
            packetFactory     = null;
            responsePacket    = null;

            try
            {
                if (ScreenThread != null && ScreenThread.IsAlive)
                {
                    ScreenThread.Abort();
                }
            }
            catch { }
            mouseController.Dispose();
            mouseController = null;

            keyboardController.Dispose();
            keyboardController = null;

            commander.Dispose();
            commander = null;

            screenGrabber.Dispose();
            screenGrabber = null;

            if (nextScreen != null)
            {
                nextScreen.Dispose();
            }
            if (prevScreen != null)
            {
                prevScreen.Dispose();
            }
            if (difference != null)
            {
                difference.Dispose();
            }

            GC.SuppressFinalize(this);
        }
Пример #8
0
 public void Dispose()
 {
     serverHandler = null;
     packetFactory = null;
     GC.SuppressFinalize(this);
 }
Пример #9
0
 public LdpPreparableInfoRequestHandler()
 {
     packetFactory = new LdpProtocolPacketFactory();
     serverHandler = LdpServer.GetInstance();
     serverHandler.GetListenerChannel.AddListener(this);
 }