From: jeljer te Wies Date: 2010-02-14T17:12:49+09:00 Subject: Re: how to detect used protocol (SOAP, JSON, XML etc.) Hi Brian, Thank you for your insights in this matter. I do think it is not unlikely to have raw tcp sockets for transportation. It is really possible: "For example, you wouldn't be able to send multiple messages over the same connection, because the only way the endpoint would be able to determine that the message had finished would be waiting for the socket to close (*)." This is not true. you could initiate a special protocol. for example: the sender first sends the amount of traffic it wants to send (just in integer) so the receiver knows what he can expect. so for example: - 51 - {"server":"menus", "method":"deleteItem", "id":"2"} this way you could have persistent connections (believe me it works I have tried it). I am not using this though. My current setup is just one request per tcp connection (the server wil just close it afther one request). I know that if (for example a web browser needs more requests it has to initiate a new connection for every request). I think this is just a very small burden (or is it ? ). "But even in that case you can have multiple endpoints, by listening on different TCP ports. So make your SOAP listener listen on one port, and your JSON one on a different port." This is a very good solution !! (i, of course, thought about it but only for maybe a split second :P ). I would still have to check the message (ports could of course be set wrong). SO if i want persistent and non persistent connections (and maybe even UDP) i have just two options: move everything to HTTP1.1 compliance OR have different TCP connections for the different "protocols"/"adapters" (or whatever you would like to call it) :P Thanxs Brian! I am doing this research/building for my final thesis (on my own) and I am building the prototype in RUBY (and then build the real thing in C/C++ (beceause in Ruby it wil be SLLOOOOWW)) :P. It is nice to have a forum where people like you actually take the time to give different insights ! Of course everybody is still welcome to spam his (or hers) opinion!!! (I think these discussions are really interesting :) ) greets Jeljer -- Posted via http://www.ruby-forum.com/.