Epicenter_SERVER.FileServer.StartListeningForFile C# (CSharp) Method

StartListeningForFile() public method

public StartListeningForFile ( ) : void
return void
        public void StartListeningForFile()
        {
            isListening = true;

            Thread thListening = new Thread(new ParameterizedThreadStart(Listener));
            thListening.Start((object)false);
        }

Usage Example

        private void btnFileDownload_Click(object sender, EventArgs e)
        {
            int transfPort = 0;

            if (!Int32.TryParse(txtTransferPort.Text, out transfPort))
            {
                MessageBox.Show("Please put in a valid port before requesting a file.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (listFiles.SelectedItems.Count != 1)
            {
                return;
            }

            if (listFiles.SelectedItems[0].SubItems[1].Text != "FILE")
            {
                return;
            }

            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                FileServer fs = new FileServer(this, ip, transfPort, sfd.FileName, String.Empty);
                fs.StartListeningForFile();

                SendASCII("SEND_FILE<%SEP%>" + txtLocation.Text + listFiles.SelectedItems[0].SubItems[0].Text + "<%SEP%>" + txtTransferPort.Text);
                SetText(lblStatus, "REQUEST sent. Awaiting for initial data.");
            }
        }
All Usage Examples Of Epicenter_SERVER.FileServer::StartListeningForFile