« Return to Thread: Simple chat application

Simple chat application

by Niels Bosma :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

I'm trying to create a very simple chat application in Flex/.Net (based on the examples) using FlurineFX but can't get it to work. I don't require any login for what I want to achieve, so I haven't implemented anything on the server side. I feel that I'm missing something on the server side config???

I'm using Flex 3.

    <mx:VBox
        width="100%"
        height="100%"
        xmlns:mx="http://www.adobe.com/2006/mxml">
   
    <mx:Style source="../../../Monkeywrench.css"/>
   
    <mx:Script>
    <![CDATA[
   
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.messaging.*;
    import mx.messaging.messages.*;
    import mx.messaging.events.*;
    import mx.core.Application;
   
    private function messageHandler(event:MessageEvent):void
    {
        txtLog.text += event.message.body.userId + ": " + event.message.body.text + "\n";
    }
   
    private function messagefaultHandler(event:MessageFaultEvent):void
    {
        Alert.show(event.faultString, "Error");
    }
   
    public function sendMessage():void
    {
        var message:AsyncMessage = new AsyncMessage();
        message.body = {userId: Application.application.auth.user.Email, text: txtOutput.text}
        producer.send(message);
        txtOutput.text="";
    }
   
    ]]>
    </mx:Script>
   
    <mx:Consumer id="consumer" destination="chat" message="messageHandler(event)" fault="messagefaultHandler(event)"/>
    <mx:Producer id="producer" destination="chat" fault="messagefaultHandler(event)"/>
   
    <mx:TextArea height="100%" width="100%" editable="false" id="txtLog"/>
   
    <mx:HBox width="100%">
   
        <mx:TextInput width="100%" id="txtOutput"/>
        <mx:Button label="Skicka" click="sendMessage()"/>
   
    </mx:HBox>
   
    </mx:VBox>

My services-config.xml:

    <?xml version="1.0" encoding="utf-8" ?>
    <services-config>
        <services>
   
            <service id="message-service" class="flex.messaging.services.MessageService" messageTypes="flex.messaging.messages.AsyncMessage">
                <adapters>
                    <adapter-definition id="messagingAdapter" class="FluorineFx.Messaging.Services.Messaging.MessagingAdapter" default="true"/>
                </adapters>
                <destination id="chat">
                    <adapter ref="messagingAdapter"/>
                    <channels>
                        <channel ref="my-rtmp"/>
                    </channels>
                    <properties>
                        <network>
                            <session-timeout>20</session-timeout>
                        </network>
                        <server>
                            <allow-subtopics>true</allow-subtopics>
                        </server>
                    </properties>
                    <!--
                    <security>
                        <security-constraint ref="privileged-users"/>
                    </security>
                    -->
                </destination>
            </service>
   
        </services>
   
        <channels>
   
            <channel-definition id="my-rtmp" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="rtmp://{server.name}:1950" class="flex.messaging.endpoints.RTMPEndpoint"/>
            </channel-definition>
           
        </channels>
    </services-config>

It's compiling all fine, and when I try to send I don't get any errors, but also no result. No message is received. Am I on the right path? What's the logic behind the endpoint uri? What port should I use? Should I configurate Web.config? (beyond the flourinefx configs that enable RemotingService?) I don't get any errors in the flourine.log.

Thanks

--
Niels Bosma
Teknikansvarig
niels@...
+46767742725
Offerta.se


_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com

 « Return to Thread: Simple chat application