Exemple #1
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            // 
            // TODO: Insert code to perform background work
            //
            // If you start any asynchronous methods here, prevent the task
            // from closing prematurely by using BackgroundTaskDeferral as
            // described in http://aka.ms/backgroundtaskdeferral
            //

            BackgroundTaskDeferral background = taskInstance.GetDeferral();

            var server = new ServerTcp(9000);
            server.OnError += Server_OnError;
            server.OnDataReceive += Server_OnDataReceive;

            ThreadPool.RunAsync(x =>
            {
                server.StartAsync();
            });
        }
Exemple #2
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            //
            // TODO: Insert code to perform background work
            //
            // If you start any asynchronous methods here, prevent the task
            // from closing prematurely by using BackgroundTaskDeferral as
            // described in http://aka.ms/backgroundtaskdeferral
            //

            BackgroundTaskDeferral background = taskInstance.GetDeferral();

            var server = new ServerTcp(9000);

            server.OnError       += Server_OnError;
            server.OnDataReceive += Server_OnDataReceive;

            ThreadPool.RunAsync(x =>
            {
                server.StartAsync();
            });
        }
Exemple #3
0
 private void Server_OnError(ServerTcp sender, string args)
 {
 }
Exemple #4
0
 private async void Server_OnDataReceive(ServerTcp sender, string args)
 {
     //Answear text Recive
     await sender.SendAsync(string.Concat("Text Recive:", args));
 }
Exemple #5
0
 private void Server_OnError(ServerTcp sender, string args)
 {
 }
Exemple #6
0
 private async void Server_OnDataReceive(ServerTcp sender, string args)
 {
     //Answear text Recive
     await sender.SendAsync(string.Concat("Text Recive:", args));
 }