Thread: Instant message

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    23

    Instant message

    So I have a project my team is working on. We are making an instant message program in C. We need some ideas. I am not gana tell what we have come up with because i want to hear other solutions. How would you guys start on this?

  2. #2
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    is it even possible in c?

  3. #3
    Registered User
    Join Date
    Apr 2007
    Location
    Greece
    Posts
    52
    1) Read sockets.
    2) Take a look at an open source project.
    3) If you are sure that can do it in C, then don't do it. But keep in mind, that C can do almost anything (but it's very hard for some applications)

    Suggestion: Move this topic to Networking/Device Communication.

  4. #4
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    It can be done in C. As to how easy it is, is debatable.

    Socket programming is a possible solution
    Some help for your program may be found here:

    http://beej.us/guide/bgnet/output/ht...age/index.html

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    What about RPC?

  6. #6
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    I don't know what RPC is sorry.

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    k so our group decided on socets. Winsockets something like that. are there any pseudo code you guys know about for this?

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Not quite pseudo-code, but something along these lines:

    The simple solution is to do the socket work in two threads, one that is reading the keyboard and sending to the socket for the other participant(s(), and one that is reading the socket of the other participants.

    You'll probably actually need a third thread that is writing the output too the screen.

    You will need a method of discovery - how to find other people you can talk to.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    You don't really need to find other people to talk to for a simple messaging system.

    First work on making a connection across 2 known computer addresses.
    Then work on requests for adding based on IP or a similar communication protocol.

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by JFonseka View Post
    You don't really need to find other people to talk to for a simple messaging system.

    First work on making a connection across 2 known computer addresses.
    Then work on requests for adding based on IP or a similar communication protocol.
    Sure, you can do that as a first step - but eventually, you'll want to find other people automaticaly, not knowing their IP address (or machine name so that you can get the IP address).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Cross-posted and bumped all over the place.
    http://cboard.cprogramming.com/showthread.php?t=95997
    This one is done, stick a fork in it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange string behavior
    By jcafaro10 in forum C Programming
    Replies: 2
    Last Post: 04-07-2009, 07:38 PM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM