Welcome Guest Search | Active Topics | Members | Log In | Register

Error in Network app Options
Alexsniper
Posted: Saturday, March 13, 2010 12:06:54 AM
Rank: Newbie
Groups: Member

Joined: 3/12/2010
Posts: 1
Points: 3
Location: Egypt
عندي مشكلة في اول برنامج اكتبه في برمجة الشبكات وهو البرنامج الاول في كتاب احترف برمجة الشبكات
الخطأ هو
No connection could be made because the target machine actively
refused it 127.0.0.1:5020

الكود هو
Code:

private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                MemoryStream ms = new MemoryStream();
                //Save the picture in memory stream
                pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat);

                //convert image to binary data
                byte[] buffer = ms.GetBuffer();
                ms.Close();
                //connecting with the server
                TcpClient tcpClient = new TcpClient(textBox1.Text, 11000);

                NetworkStream ns = tcpClient.GetStream();
                BinaryWriter bw = new BinaryWriter(ns);
                //send the stream to the address
                bw.Write(buffer);
            }
            catch (SocketException ex)
            { MessageBox.Show(ex.Message); }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }

Fadi Abdelqader
Posted: Thursday, March 18, 2010 10:12:09 AM

Rank: Administration
Groups: Administration

Joined: 4/9/2008
Posts: 80
Points: 17
Location: SocketCoder.Com
Do you use the same port (11000) on the listener on the other side?


Visit our blog http://socketcoder.blogspot.com
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.038 seconds.