CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2000
    Posts
    440

    Multiuser Network Enabled App

    Hello,

    I am trying to create a network enabled application. That would mean that it will have a database server and one or more instances of my app running on different machines. The problem is that each machine need to have a way to notify the other machine that some event happened. In short: how can one machine broadcast some information to the other machines.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452
    Two ways I can think of right off hand.

    1. Use your database. Create a table just for messages.

    2. Probably more along the lines of what you are looking for, use the winsock control. Look in the help file under Winsock Control, then using the Winsock Cotrol for a few examples. Or you can search here or PlanetSourceCode for "CHAT"

    Hope this helps.
    Roger

  3. #3
    Join Date
    Feb 2000
    Posts
    440
    What I need to send is events. I.e when some action happens in one of comuter, all other must receive notification along with other infomration about the event. A table for messages may do the job but there will be unnecessary database server overload. Also there are other problems like: When event occur, how each station knows that it will not process it more than once, how long the message stays in the table etc.

    About the Winsock control: As I understand the recipient and the sender should be known, Is it possible that the sender broadcast the message so that more than one station receive the message?

  4. #4
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487
    About the winsock and a common datasource you could enable the broadcasting..

    1. Use a UDP winsock.
    2. Use the a common log table.

    Every application should just log his ip address into the log table. .. Then the program could just retrieve the coverage (recordset) from this table, then send each record with a message (notify) by just switching the UDP socket's remotehost property with the ip address...Broadcasting!!
    Busy

  5. #5
    Join Date
    Feb 2000
    Posts
    440
    Thanks to both Chay Luna and Roger for their ideas.

    I think that UDP protocol and the ip address logging into table will do the job.

    Regards

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