ApplicationMessageCenter Library

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sside
    New Member
    • Dec 2003
    • 475

    ApplicationMessageCenter Library

    ApplicationMessageCenter library (ApplicationMessageCenter.dll v.1.0.0.0).
    ApplicationMessageCenter library makes possible that 2 or more application to comunicate with each other. It is a 2 in 1 solution, client and server.

    Actions:
    ApplicationMessageCenter.Client.Connect
    ApplicationMessageCenter.Client.Disconnect
    ApplicationMessageCenter.Client.AddEntry
    ApplicationMessageCenter.Client.RemoveEntry
    ApplicationMessageCenter.Client.ExistsEntry
    ApplicationMessageCenter.Client.SendMessage
    ApplicationMessageCenter.Client.ReceiveMessage
    ApplicationMessageCenter.Client.IsClientChannelReg istered
    ApplicationMessageCenter.Client.GetError
    ApplicationMessageCenter.Server.Start
    ApplicationMessageCenter.Server.Stop
    ApplicationMessageCenter.Server.IsServerChannelReg istered
    ApplicationMessageCenter.Server.GetError

    Download:
    ApplicationMessageCenter.v.1.0.0.0

    Contents:
    ApplicationMessageCenter.xml //Actions. Drop this to: C:\Program Files\AutoPlay Media Studio 5.0 Professional\Data\Actions.
    ApplicationMessageCenter.Blank.Project.apt //Template. Drop this to: C:\Program Files\AutoPlay Media Studio 5.0 Professional\Templates.
    Client1.apz //Demo. A demo project to show the ApplicationMessageCenter.dll usage.
    Client2.apz //Demo. A demo project to show the ApplicationMessageCenter.dll usage.
    Server.apz //Demo. A demo project to show the ApplicationMessageCenter.dll usage.

    Start the server and both clients to see what it does. It is a simple project where 2 client can exchange messages with each other. When you start the server some firewalls can/will ask you for permission. Grant it if you want to see what it does, otherwise not.

    Client applications can exchange messages not only from the same computer but also from lan and wan. Clients and server can be in different computer, cities, countries etc. 2 clients and a server can be in 3 different computers.

    3 protocols are supported:
    1-Http
    2-Tcp
    3-Ipc (only when the clients are in the same computer).

    Server can operate in three protocols in the same time. Client only one at a time. Thus clients can connect at server at any channel assuming that server is listening for incomming calls at all channels.

    It is important that the dll stays at the root dir (where the exe is).

    How to use it:
    How you like it. But as a rule follow this patterns:

    Code:
    ApplicationMessageCenter.Client.Connect([I]Channel[/I], [I]Host[/I]);
    Channel: You can choose from the 3 channels Http, Tcp, Ipc.
    Host: Computername for lan. Ip address for wan.
    Required. This is the very first actions a client must call.

    Code:
    ApplicationMessageCenter.Client.AddEntry([I]AppId[/I]);

    AppId: Any unique string value.
    Optional. AddEntry is optional. It is not needded to send but to receive yes. It is a kind of message box that will be created at server where messages will be stored untill you recive them.

    After you are successfully connected you can send messages.
    Code:
    ApplicationMessageCenter.Client.SendMessage(sender, receiver, messageText, messageData);
    After you have connected and created the entry (AddEntry) you can receive (or send) messages.
    Code:
    ApplicationMessageCenter.Client.ReceiveMessage(receiver);
    Messages are not defined. It is up to you to define your own messages.
    Applications can exchange not only messages but also files (small files though). But right now we keep it simple and exchange only messages

    .Net 2.0 required.

    With Kind Regards
    sside
  • johnraus
    Indigo Rose Customer
    • May 2004
    • 169

    #2
    COOOooooollllll

    This is something to Toy with

    Thnx for sharing

    Comment

    • nic3388
      Forum Member
      • Sep 2006
      • 3

      #3
      Thanks

      Can you attach this to a post as your website appears to be down, thanks.

      Comment

      • sside
        New Member
        • Dec 2003
        • 475

        #4
        With Kind Regards
        sside

        Comment

        • sside
          New Member
          • Dec 2003
          • 475

          #5
          ApplicationMessageCenter Library (v.1.0.0.2)

          Functions:
          1. AddEntry
          2. RemoveEntry
          3. ExistsEntry
          4. GetEntries
          5. GetEntryInfo
          6. SetEntryStatus
          7. SendMessage
          8. ReceiveMessage
          9. ReadMessage
          10. GetMessageCount
          11. Connect
          12. Disconnect
          13. IsClientChannelRegistered
          14. GetClientError
          15. Start
          16. Stop
          17. IsServerChannelRegistered
          18. GetServerError


          .Net 2.0 required

          With Kind Regards
          sside

          Comment

          • Teqskater
            Forum Member
            • Apr 2007
            • 175

            #6
            Woow ****. This is what i needed for a long time. Big big thanks :yes :lol

            Comment

            • Teqskater
              Forum Member
              • Apr 2007
              • 175

              #7
              Crap did i do something wrong? *Sigh*

              Hi can somebody help me with an error. ive coded something together al week long and it works so far until i need to read a message. this is the code i use to read it.

              Code:
              nmsg = ApplicationMessageCenter.GetMessageCount(server);
              	nmsg = String.ToNumber(nmsg)
              	Label.SetText("Messages:", "Messages: "..nmsg.."");
              	
              	if nmsg > 0 then
              		for x = 1, nmsg do
              			msg = ApplicationMessageCenter.ReadMessage(server, x) -- .Sender  .Receiver  .Text   .Data   .Time
              			Label.SetText("Text =", "Text = "..msg.Text);
              			Label.SetText("Data =", "Data = "..msg.Data);
              		end
              	end
              i send a message with my client and then the server that needs to recieve that message executes the code above. Label "Messages:" text changes to "Messages: 1". then it reads it but doesnt put out anything in the labels "Text =" and "Data =" and i am 100% sure it gets to those lines:
              Code:
              Label.SetText("Text =", "Text = "..msg.Text);
              			Label.SetText("Data =", "Data = "..msg.Data);
              I slightly modified the functions names only the ones like this: ApplicationMessageCenter.Server.Start changed to ApplicationMessageCenter.ServerStart (i did this to properly create an xml for the action wizzard so that it shows up there). Further i didnt move the dll or changed its name. i even tryed to get an error with some code i deleted but it doesnt return any message. I feel a bit down right now because i spend very much ours coding something and now when i get to a point that it needs to work and it doesnt. Sside or someone else can you help me please. Thanks people.

              Comment

              • sside
                New Member
                • Dec 2003
                • 475

                #8
                Teqskater

                A few things i would think of:
                1. Make sure thew server is listening.
                2. ReadMessage index is zero bassed (for x=0).
                3. Make sure you are sending to the correct server (check server name).


                What number returns GetMessageCount? Is it bigger than 0?
                If that be the case then put a messagebox inside the loop and see if sender is being displayed properly.

                With Kind Regards
                sside

                Comment

                • Teqskater
                  Forum Member
                  • Apr 2007
                  • 175

                  #9
                  I found the trouble. I didnt know that the ReadMessage index was zero based. And it doesnt work with the ICP channel (no problem for me because i use ICP now). But i have another question: when you read a message it doesnt go away out of the entry? How does the recieve message function work if there are two messages or more? does it read message one for example and the next time its called message two or how does it work? Thanks for your help so far! Btw im creating a multiplayer card game with it and i think when im done i release the source code over here in the forums i think. it also has more then 10 functions that deal cards, turnover cards ETC.
                  Last edited by Teqskater; 08-14-2008, 06:30 PM.

                  Comment

                  • sside
                    New Member
                    • Dec 2003
                    • 475

                    #10
                    Teqskater

                    Ipc channel works only for local connections. It does not work for remote connections. One example would be when the server and client are located in same computer.

                    ReadMesage does not remove the message.

                    ReceiveMessage gets you the message and removes it from the message queue (fifo). If there are more messages then call ReceiveMessage in a loop, page timer, or until returns an empty string.

                    With Kind Regards
                    sside

                    Comment

                    • Teqskater
                      Forum Member
                      • Apr 2007
                      • 175

                      #11
                      Alright. Thanks

                      Alright thanks again forgot to mention in the previous post that i was using ICP localy and it still didnt work and i was pretty sure i didnt do anything wrong. But i could be wrong. I never now because i changed the code now.

                      Alright it works now. I simply changed ReadMessage To Recievemessage. Now everything works. :yes

                      Big thanks,

                      Teqskater

                      Comment

                      • sside
                        New Member
                        • Dec 2003
                        • 475

                        #12
                        Make sure then that the server is also listening in Ipc channel.

                        With Kind Regards
                        sside

                        Comment

                        • Teqskater
                          Forum Member
                          • Apr 2007
                          • 175

                          #13
                          Oh forgot this. Wich ports does it use. i cant find them.

                          Comment

                          • sside
                            New Member
                            • Dec 2003
                            • 475

                            #14
                            You don't need the port nr to connect to a server.

                            Here they are for your convinience:

                            Http channel (11771)
                            Tcp channel (11772)
                            Ipc chanel (11773)

                            You could run a netstat and get those numbers as well.

                            With Kind Regards
                            sside

                            Comment

                            • Teqskater
                              Forum Member
                              • Apr 2007
                              • 175

                              #15
                              I know that but i need those port numbers to forward them in my router etc.

                              Comment

                              Working...
                              X