tag:blogger.com,1999:blog-3915544030735587425.comments2011-08-07T15:51:05.228-07:00Development for the massesronenhttp://www.blogger.com/profile/13360463320878175457noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-3915544030735587425.post-66456915946756451822009-11-08T01:29:25.025-08:002009-11-08T01:29:25.025-08:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-67461796110673237362009-07-23T13:11:09.245-07:002009-07-23T13:11:09.245-07:00Can you post the snippet that your are trying to r...Can you post the snippet that your are trying to run?<br />I haven't tried to persist the AMF output but don't see a reason why it cannot be done.ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-12318022161693302962009-07-23T00:40:49.914-07:002009-07-23T00:40:49.914-07:00If I'm simply trying to read an AMF message in...If I'm simply trying to read an AMF message in binary format in from disk and perform Amf3Input.readObject() on the input stream, what do I need to do to initialize the SerializableContext? I keep getting classloader exceptions when trying to instantiate Amf3Input.morrisnoreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-7140499473870055142009-07-22T11:33:47.166-07:002009-07-22T11:33:47.166-07:00The reason iv used BASE64 encoding was due to the ...The reason iv used BASE64 encoding was due to the fact that the example uses the stomp Java library which send strings, if your using a bare socket than its possible to send the binary data without the encoding. <br /><br />Id like also to recommend you both to take a look on the <a href="http://www.springsource.org/spring-flex" rel="nofollow">Spring BlazeDS integration</a> project. <br /><br />My example is good when you are trying to use bare (or custom) protocols (like stomp or XMPP), not for so called "standard" integrations.ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-17784737473544610512009-07-22T07:24:54.176-07:002009-07-22T07:24:54.176-07:00Yeah, "some" not a lot though.
Personall...Yeah, "some" not a lot though.<br />Personally I would not create my own socket server, I don't really see a reason not to an existing one like red5, SmartFoxServer, Flash Media Interactive Server, Project Darkstar, etc.<br /><br />red5 I can't say much about.<br /><br />SmartFoxServer, also Java, is quite nice but it has some limits, and its not free either.<br /><br />Flash Media Interactive Server is cool, and easy to use. It uses actionscript on the server side.<br />But it's expensive and has no scalabilty features.<br /><br />I'd go with Project Darkstar which is open source, that's what I'm using now and I love it, also Java.<br />I's still under heavy development and currently only supports one node, but it's working real good and keeps getting better.Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-37873616718608342692009-07-22T06:44:17.880-07:002009-07-22T06:44:17.880-07:00Oscar, you seem to have some experience working wi...Oscar, you seem to have some experience working with socket servers. What server would you recommand i use for a online poker? Should i create my own server from scratch or i ca modify an existing one like red5 ?<br />Thanks.mironcaiushttps://www.blogger.com/profile/08009520721541418385noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-11490041392727175932009-07-22T05:51:37.156-07:002009-07-22T05:51:37.156-07:00Caius, decoding it does not recude the data, it in...Caius, decoding it does not recude the data, it increases it. I removed the base64 decoding for my code. Normally it's a waste of both cpu and bandwidth, but if you are using SmartFoxServer for instance, you need to decode it since it only handles strings and not byteArrays.<br /><br />By the way, Ronen.. The code i showed you which i cut out from yours and edited was correct and it did work.<br />The reason I couldn't get it to work was because I had missed to add one of the needed libraries, heh stupid me.<br />I assumed I would get a compile-time error for that, I'm not that experienced with Java.<br /><br />By the way, here's another working implementation of BlazeDS-serialization<br />http://snipplr.com/view.php?codeview&id=7820Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-30765771747959927422009-07-22T05:04:33.335-07:002009-07-22T05:04:33.335-07:00Firstly the example is very useful to understand, ...Firstly the example is very useful to understand, thanks.<br />But what i don understant is why you decode and encode the data that you are sending back and forth, does it reduce the amount of data ? <br />I have been working with your example, and asked around because it had problems. I asled the guy from RED5 server and he told me:<br /><br />"but why would you serialize a binary format to string and send the string instead of the binary data ?"<br />and " amf serialization is player native. just make sure to use Socket.writeObject and Socket.readObject (also available in ByteArray so you collect your data in a ByteArray and write the resulting bytes to the socket using Socket.writeBytes)"<br /><br />So I dont think you need to encode/decode and also you should send the data in raw format, after you call writeObject. What do you think ?mironcaiushttps://www.blogger.com/profile/08009520721541418385noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-14483736298013003232009-07-20T12:00:45.059-07:002009-07-20T12:00:45.059-07:00amf3Input.readObject();// reads out the object.
T...amf3Input.readObject();// reads out the object.<br /><br />The best advice that i can give is to take a look into <a href="http://github.com/narkisr/stomp-poc/tree/master" rel="nofollow">this</a>, its the complete example on both ends.ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-42714453024056584162009-07-20T11:13:32.744-07:002009-07-20T11:13:32.744-07:00Hello,
I have been working on your examples for a ...Hello,<br />I have been working on your examples for a while but i cannot make them to work.<br />I have created a socket server and whenever i send data to the server i get extra caracters and if i run fromAmf(String).. it totally decodes it wrong. <br />Let's say i solve the extra caracters problem, how can i extract the object from the Amf3Input amf3Input ?<br />Thanks,mironcaiushttps://www.blogger.com/profile/08009520721541418385noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-7028449806814125242009-07-17T12:26:56.583-07:002009-07-17T12:26:56.583-07:00I've done some more research now, firstly I...I've done some more research now, firstly I've found this working example using blazeDS.<br />And secondly I've found out graniteDS can also convert objects in java to AMF3. I've looked at the API documentation and it looks to me I just need to create a amf3serializer object and pass a input-object and a output-bytearray.<br />I'll compare the performance of these two when i get home.<br />Hopefully, and problaby I'll manage to do this with these 2 options.<br />Thanks a lot for all your help, Ronen =)Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-53606993924994757782009-07-17T11:57:46.457-07:002009-07-17T11:57:46.457-07:00Well, the braces are balanced. And it's not a ...Well, the braces are balanced. And it's not a syntax or compiler error, it's a runtime error at that line.<br />Thanks, I'll take a look at your code when i get home and see if I can adopt it to my project. But.. Well, I don't really know what maven is. Would I need to use maven just to get that part working? All I want to do is convert a simple object to a amf-bytearray, I figured that coulnd't be so complicated but it looks like I was wrong...Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-53896970561846949302009-07-16T17:30:08.224-07:002009-07-16T17:30:08.224-07:00Try removing line 22 (the braces don't seem to...Try removing line 22 (the braces don't seem to be balanced), <br />In any case iv already published the entire original example <a href="http://github.com/narkisr/stomp-poc/tree/master" rel="nofollow">here</a>.<br /><br />It uses maven, in order to build it you will need a maven proxy server (<a href="http://www.jfrog.org/index.php" rel="nofollow">artifactory</a>).ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-79108951059404527412009-07-16T17:05:25.367-07:002009-07-16T17:05:25.367-07:00Thanks a lot for the time you're taking trying...Thanks a lot for the time you're taking trying to help me.<br />I made a test-app and put that code you provided me with in the main-function, but it still spits out an error.<br />Could you take a look at it and see where I've gone wrong?<br />The error is at line 40<br /><br />http://gist.github.com/148763<br /><br />Thank YouOgganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-26989646421755683112009-07-16T13:26:52.431-07:002009-07-16T13:26:52.431-07:00This should work http://gist.github.com/148668This should work http://gist.github.com/148668ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-59452553240429931152009-07-16T13:11:01.987-07:002009-07-16T13:11:01.987-07:00Okay...
So what do I need to do to get amf3Output ...Okay...<br />So what do I need to do to get amf3Output to work? Either without or with guice i guess.<br /><br />I do see you pass in the variable "context" when creating the amf3Output, but I don't even see where it's initialized or anything, just where it's declared, so I'm confused =S<br /><br />Thanks again...Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-8520468161018776092009-07-16T12:43:03.250-07:002009-07-16T12:43:03.250-07:00The example shown uses guice which is an IOC frame...The example shown uses <a href="http://code.google.com/p/google-guice" rel="nofollow">guice</a> which is an IOC framework, the SerializationContext is injected into the context data member.<br /><br />The SerializationContextProvider is the factory from which context instances are created (see the get method).<br /><br />You don't have to use guice, but it does make the code cleaner.ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-47593404442041065862009-07-16T09:39:25.003-07:002009-07-16T09:39:25.003-07:00Heh, sorry, looks like I'm in need of even mor...Heh, sorry, looks like I'm in need of even more help. I've now tried to convert an object to amf3 in java but I'm having problems.<br />I Suppose these 3 lines are basically what I need:<br />amf3Output = new Amf3Output(context);<br />amf3Output.setOutputStream(bout);<br />amf3Output.writeObject(source);<br />the second and third lines make sense, it's the first that confuses me. "context" what are you supposed to pass in there? I've tried finding the answer for quite a while now but can't seem to find it.<br />Any help is very appreciated.<br />Thanks in advanceOgganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-66200755282473826802009-07-14T12:27:47.503-07:002009-07-14T12:27:47.503-07:00Cool, glad it helpedCool, glad it helpedronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-54215946802113781352009-07-14T10:38:46.352-07:002009-07-14T10:38:46.352-07:00I could only find 2 downloads, one with the source...I could only find 2 downloads, one with the source, and one with a war. I didn't know what a war was, but you pointed me in the right direction, I just managed to extract its contents and get the jar =)<br />Thanks a lot, I really appreciate it.<br />And good tutorial too =)Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-5060688301017104952009-07-14T10:09:25.080-07:002009-07-14T10:09:25.080-07:00Well im using SyntaxHighlighter, you could embed i...Well im using <a href="http://code.google.com/p/syntaxhighlighter/" rel="nofollow">SyntaxHighlighter</a>, you could embed it within the Blogger template.ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-13229567793827806402009-07-14T10:02:55.237-07:002009-07-14T10:02:55.237-07:00Well iv found it under the3.2 tag.
It there a rea...Well iv found it under the<a href="http://opensource.adobe.com/svn/opensource/blazeds/tags/3.2.0/modules/core/src/java/flex/messaging/io/amf/Amf3Output.java" rel="nofollow">3.2 tag</a>.<br /><br />It there a reason your using the source instead of the jar?ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-69358387195777399672009-07-14T03:52:42.396-07:002009-07-14T03:52:42.396-07:00For my project I need to convert a java object to ...For my project I need to convert a java object to amf, I found your article on it and it looks like I'll need to use the amf3Output class.<br /><br />I downloaded the blazeDS source files but I wasn't able to find<br />flex.messaging.io.amf.Amf3Output <br />anywhere.<br />Where is it...? Or am I doing something wrong?<br />Thanks in advance =)Ogganhttps://www.blogger.com/profile/16802966111020000213noreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-74394303479064288662009-07-08T16:30:32.358-07:002009-07-08T16:30:32.358-07:00These mocking tips were really helpful. Apart from...These mocking tips were really helpful. Apart from this, could you please let me know that how do you put java code and xml/html in blogger post.<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3915544030735587425.post-49789537509939921222009-05-25T12:00:52.122-07:002009-05-25T12:00:52.122-07:00Cool iv never noticed this form before.
Ill updat...Cool iv never noticed this form before.<br /><br />Ill update the article to spare time for those like myself :)ronenhttps://www.blogger.com/profile/13360463320878175457noreply@blogger.com