This project has moved. For the latest updates, please go here.

Using code in WinForm application

May 16, 2016 at 10:25 PM
Hello,
I am trying to use this library in a Win Form application. I am following the code in the sample server and I am running into a problem. When I use the following code
       using (var server = new TftpServer())
        {
            server.OnReadRequest += new TftpServerEventHandler(server_OnReadRequest);
            server.OnWriteRequest += new TftpServerEventHandler(server_OnWriteRequest);
            server.Start();
            Console.Read();
        }
It does not work in Win Form, the Console.Read() does not block this thread and the server code just exits. I tried creating a thread but is not sure how to thread this out. Can any one give me some suggestion how to incorporate this code?

Thanks
Denny