Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Direct Chat Over Internet

Direct Chat Over Internet

Scheduled Pinned Locked Moved C#
csharpvisual-studiosysadminhelpquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GermanDM
    wrote on last edited by
    #1

    Hi there, I am trying develope an internet chat application in C#.Net using Visual Studio 2005. I am struggling succeeding in this and basically ended up creating a network chat app. What i want to do is create an app that direct chats over the internet (like on a network chat). only my friend and myself will use it so no rooms or anything is needed its just a plain direct chat over the net.peer 2 peer like. I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat. Could anyone please help me with this or direct me somewhere where i can get help please? Kind Regards Deon

    S C 2 Replies Last reply
    0
    • G GermanDM

      Hi there, I am trying develope an internet chat application in C#.Net using Visual Studio 2005. I am struggling succeeding in this and basically ended up creating a network chat app. What i want to do is create an app that direct chats over the internet (like on a network chat). only my friend and myself will use it so no rooms or anything is needed its just a plain direct chat over the net.peer 2 peer like. I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat. Could anyone please help me with this or direct me somewhere where i can get help please? Kind Regards Deon

      S Offline
      S Offline
      sanki779
      wrote on last edited by
      #2

      Tell me 1 thing buddy are you in a private n/w or on the public n/w? If youa re in a public n/w thn it should not b a issue.

      G D 2 Replies Last reply
      0
      • S sanki779

        Tell me 1 thing buddy are you in a private n/w or on the public n/w? If youa re in a public n/w thn it should not b a issue.

        G Offline
        G Offline
        GermanDM
        wrote on last edited by
        #3

        Im in a private network and my friend will be in a public network. hmmmm i guess firewalls will be a problem ouch. any suggestions maybe? im so confused and i know this is not alot of code it only has to be the most simplest app which sends text like p2p. i have some code i you want to take a look at it and maybe direct me from there. Thanks alot

        N 1 Reply Last reply
        0
        • G GermanDM

          Im in a private network and my friend will be in a public network. hmmmm i guess firewalls will be a problem ouch. any suggestions maybe? im so confused and i know this is not alot of code it only has to be the most simplest app which sends text like p2p. i have some code i you want to take a look at it and maybe direct me from there. Thanks alot

          N Offline
          N Offline
          Nougat H
          wrote on last edited by
          #4

          If neither of you has a static ip then you'll need a web service to keep track of the ip-s for peer discovery, even if the app will be used by only the two of you.

          G 1 Reply Last reply
          0
          • G GermanDM

            Hi there, I am trying develope an internet chat application in C#.Net using Visual Studio 2005. I am struggling succeeding in this and basically ended up creating a network chat app. What i want to do is create an app that direct chats over the internet (like on a network chat). only my friend and myself will use it so no rooms or anything is needed its just a plain direct chat over the net.peer 2 peer like. I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat. Could anyone please help me with this or direct me somewhere where i can get help please? Kind Regards Deon

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            GermanDM wrote:

            I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat.

            You do know what TCP/IP means? it means Transmission Control Protocol over Internet Protocol. Which should give you a clue to how data is transmitted over the internet.


            Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

            1 Reply Last reply
            0
            • N Nougat H

              If neither of you has a static ip then you'll need a web service to keep track of the ip-s for peer discovery, even if the app will be used by only the two of you.

              G Offline
              G Offline
              GermanDM
              wrote on last edited by
              #6

              yea you right but my friend will have a static ip i think and with me well im using a netowrk ip address to connect to the internet. funny actually i dont know lol well for now lets say both of us have a static ip. here is the code i have so far what do you guys think? ok this is written so for now you chat with yourself. the strfriend will be the ip of my friend obviously lol. using System; using System.Windows.Forms; using System.Drawing; using System.Net.Sockets; using System.Threading; using System.IO; using System.ComponentModel; using System.Net; using System.Drawing.Drawing2D; namespace MyTalk { public partial class Chat : Form { private TcpClient objClient; private Thread thdListener; private TcpListener objListener; private string strFriend; private string strMe; IPAddress ipadd; public delegate void Invoker(String t); public Chat() { strFriend = "10.0.1.166"; ipadd = Dns.GetHostEntry(strFriend).AddressList[0]; strMe = "Me"; thdListener = new Thread(new ThreadStart(this.Listen)); thdListener.Start(); InitializeComponent(); } private void Listen() { string strTemp = ""; objListener = new TcpListener(ipadd,1000); objListener.Start(); do { TcpClient objClient = objListener.AcceptTcpClient(); StreamReader objReader = new StreamReader(objClient.GetStream()); while (objReader.Peek() != -1) { strTemp += Convert.ToChar(objReader.Read()).ToString(); } object[] objParams = new object[] { strTemp }; strTemp = ""; this.Invoke(new Invoker(this.ShowMessage), objParams); } while (true != false); } private void ShowMessage(String t) { rtbMessage.Text += strFriend + ": " + t + "\n"; } private void btExit_Click(object sender, EventArgs e) { objListener.Stop(); Application.Exit(); Environment.Exit(0); } private void btSend_Click(object sender, EventArgs e) { rtbMessage.Text += strMe + ": " + rtbType.Text + "\n"; objClient = new TcpClient(strFriend, 1002); StreamWriter w = new S

              1 Reply Last reply
              0
              • S sanki779

                Tell me 1 thing buddy are you in a private n/w or on the public n/w? If youa re in a public n/w thn it should not b a issue.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                You've got a full 101-key keyboard in front of you - use it. SMS-speak is frowned upon because it makes your posts hard to read.

                Dave Kreskowiak Microsoft MVP - Visual Basic

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups