Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0 C# Networking Network TCP/IP , +
i wanna send one file through ip address i got error like this
No connection could be made because the target machine actively refused it

Below coding i written in this program....this is program error or it's related to firewall proble....but in my system i disable the firewall...

pls help me....

private void btnProcess1_Click(object sender, EventArgs e)
            //----------------> Request to Central Server <----------------
           // TcpClient tc1 = new TcpClient();
            TcpClient tc1 = new TcpClient(txtGroupA.Text, 80);
            NetworkStream ns1 = tc1.GetStream();
            BinaryFormatter bf1 = new BinaryFormatter();
            bf1.Serialize(ns1, "Send Particulars of MultigroupA");
            TcpListener listen;
            Socket sk;
            listen = new TcpListener(8000);
            sk = listen.AcceptSocket();
            NetworkStream ns = new NetworkStream(sk);
            BinaryFormatter bf = new BinaryFormatter();
            object op;
            op = bf.Deserialize(ns);
            string returndata1 = op.ToString();
            char[] spiltch1 = { ' ' };
            string[] spit1 = null;
            spit1 = returndata1.Split(spiltch1);
            a11 = spit1[0].ToString();
            b1 = spit1[1].ToString();
            c1 = spit1[2].ToString();
            d1 = spit1[3].ToString();
            e1 = spit1[4].ToString();
            f1 = spit1[5].ToString();
            g1 = spit1[6].ToString();
            h1 = spit1[7].ToString();
            i1 = spit1[8].ToString();
            j1 = spit1[9].ToString();
            txtResTime1.Text = d1.ToString();
            txtPathA.Text = e1.ToString();
            txtResB.Text = i1.ToString();
            txtPathB.Text = j1.ToString();


"I got error in that highlighted line"
Posted 3-Dec-12 22:56pm
Richard MacCutchan at 4-Dec-12 4:05am
Do you have an application that is listening on port 80 at that IP address?
Deenu India at 4-Dec-12 4:10am
nope sir....this is my friend project.... he write port is 6060 but i changed to 80.... but again i'm getting the same error only....
Mendor81 at 4-Dec-12 11:14am
Probably because the 80 is a default port try use another port.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 255
1 Suvendu Shekhar Giri 215
2 Andy Lanng 210
3 PIEBALDconsult 190
4 Abhinav S 184
0 Sergey Alexandrovich Kryukov 6,310
1 OriginalGriff 5,853
2 Peter Leow 2,484
3 Maciej Los 2,263
4 Abhinav S 2,249

Advertise | Privacy | Mobile
Web03 | 2.8.150414.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100