CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2007
    Posts
    84

    [RESOLVED] chat application

    hi,
    how can i start my chat program?
    any best links for reference?
    ive been searching the net for instructions but, all were failed and have errors

    tia

  2. #2
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: chat application

    http://www.developerfusion.com/code/...program-for-c/

    this link provides a sample client -server chat programming code...

  3. #3
    Join Date
    Oct 2007
    Posts
    84

    Re: chat application

    thanks for the reply

    any more link? i cant get it working

  4. #4
    Join Date
    Oct 2007
    Posts
    84

    Re: chat application

    i have found a script
    public static void Main()
    {
    client = new Form();
    client.Text = "PCChat - Chat Client";

    client.Closing += new CancelEventHandler(ChatClient_Closing);
    client.Controls.Add(new TextBox());
    client.Controls[0].Dock = DockStyle.Fill;
    client.Controls.Add(new TextBox());
    client.Controls[1].Dock = DockStyle.Bottom;
    ((TextBox)client.Controls[0]).Multiline = true;
    ((TextBox)client.Controls[1]).Multiline = true;
    client.WindowState = FormWindowState.Maximized;
    client.Show();
    ((TextBox)client.Controls[1]).KeyUp += new KeyEventHandler(key_up);
    tcpClient = new Chat.Sockets.TcpClient();
    tcpClient.Connect("localhost", 8080);
    Thread chatThread = new Thread(new ThreadStart(run));
    chatThread.Start();
    while (true)
    {
    Application.DoEvents();
    }
    }
    but it has error
    No connection could be made because the target machine actively refused it 127.0.0.1:8080

    what seems to be the problem here?

    tia...

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: chat application

    Quote Originally Posted by homer.favenir View Post
    thanks for the reply

    any more link? i cant get it working
    From the point of view of folks answering questions, we would be able to help more if you told us specifically what wasn't working.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: chat application

    Quote Originally Posted by homer.favenir View Post
    what seems to be the problem here?
    Did you start up the server before running the client?

  7. #7
    Join Date
    Oct 2007
    Posts
    84

    Re: chat application

    tcpClient.Connect("localhost", 8080);
    has error

    yes, i execute the server first before the client and tried vice versa also

    tia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured