Hi all the stackoverflow people
i need an websocket server and client implementation example in jAVA,
i researched and not found tangible result,
please help me
thank you
Java-WebSocket
jWebSocket
First two results on a google search for java websocket. How did you not find these?
Look at Atmosphere. A lot of samples and works with all existing framework.
If you want a simple Java I/O websocket server that supports the full message length and multiple connections check this out http://code.google.com/p/jfraggws/
Related
*I have to make an android application which is basically a chat application.*In this chat app the user can interact with single user as well in a group that means Group chat is also there. I am using php as the back end for database . I have never done this type of work earlier so need some suggestions or guidance.
The options i have seen is as follow :
1. Web-services
2. Socket Programming
3. XMPP using the smack api
Now i am confused in them that which is better to implement chat feature in android. Also i didn't get any sample code for that. One of my team member is asking me to use the socket programming but i didn't get any sample app or anything for socket programming in android. I don't know socket programming this time. How we can connect the our phone to the server and then some other device. Hope you get me what i want to Conway you.
So can any one please guide me and show me the right direction to move on. Also if you can provide me any sample code, that can be really helpful. Any help is appreciated
Another option (besides XMPP, which is certainly a valid approach for chat, since it was designed for that) would be using WebSocket. Using WebSocket would open the possiblity of having a pure browser client as well.
For WebSocket on Android, there is AutobahnAndroid, part of the Autobahn family of WebSocket and WAMP implementations.
WAMP is a RPC and PubSub over WebSocket protocol with multiple implementations. There is also a PHP implementation of WebSocket/WAMP: Ratchet.
Disclaimer: I am author of Autobahn/WAMP and work for Tavendo.
For a basic Socket programming tutorial, you can check HERE and HERE.
However, I suggest using XMPP, as I have mentioned HERE, as it is a protocol designed from the ground up to be used for Messaging.
I developed a chat application using java.But now my challenge is build a chat app in web application.I dont how to proceed.Can we use sockets as done in java.
Please give me a suggestion to get through this.
Thanks in Advance.
I recommend you to use websockets as they're really efficient to exchange in real time (push instead of pull) data between a server and html clients. They're bidirectionnal and roughly equivalent to the sockets you're used to (hence their name). Client-side, they use the same callback based logic than ajax clients but that doesn't mean they're not fast.
Here's a tutorial : http://java.dzone.com/articles/creating-websocket-chat
Googling "java chat websocket" would give you other results.
I have a database in my sql and I have multiple clients using that database.
whenever a column in the database is updated I want to call the corresponding java method on the client side. Basically this is the message system, when user get new message I want to give him a notification. Is this the right way to do it? If yes how do I implement it. If not what would be the right way to do it?
Any help appreciated
Thanks
There are messaging frameworks for such reason for example :
Jabber
UDP multicast (http://download.oracle.com/javase/1.4.2/docs/api/java/net/MulticastSocket.html)
JMS (http://activemq.apache.org/)
No, this is not the right way to do it. To send messages, use message-oriented middleware (MOM), using JMS. There are free JMS implementations available (like ActiveMQ, for example).
You might find interesting the following blog post and thread: http://www.unlimitednovelty.com/2009/04/twitter-blaming-ruby-for-their-mistakes.html
The blog was written when Twitter has changed its messaging system platform from Ruby to Scala. It generated an ineteresting flame about messaging systems between experts...
Since I'm developing a multiplayer card game for Facebook using Flex as client side and Java SE as server side, I wanted to know how do I actually make the connection between Flex and Java? the server and client should be able to send each other data(cards,movement,room information etc...) across and I wonder what's the easiest way to do it without complicating it.
Any idea how to do? where to read about it ? I know JAVA but I find JavaEE hard to understand.
Any help will be appreciated, thanks.
You can pay Adobe a lot of money and use their enterprise products.
Alternatively, you can use the open source BlazeDS, which allows you to communicate with plain text (direct HTTP) or using the binary AMF protocol with object serialization.
Also, if you are thinking about using JSON, as3corelib will help you on the Flex side.
using SOAP as it is built into Flex already seems the easiest way to got...
For some information/example see
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_3.html
http://www.blackpepper.co.uk/black-pepper-blog/How-to-use-SOAP-web-services-with-Flex.html
http://www.blackpepper.co.uk/black-pepper-blog/How-to-use-SOAP-web-services-with-Java-and-Flex-Part-2-of-2.html
After carrying out some research I have found out that an RTSP media server for develivering video and audio can be implemeneted in java using Netty. After consulting the web site and veiwing the documentation I have still not found any real help on how an RTSP media server can be implemeneted using it. I have been stucktrying to solve this problem for a while now and I am well aware of the RTSP protocol, other streaming protocols and all the issues that come with streaming media. Could someone please piont me at a place to start so that I can slowly work my way through the implemenattion of an RTSP server in java (Netty). Any online documentation or source code that is reasonably close to this issue, or shows the very basics would be a great help. Thank you.
You could take a look at flazr which is Netty implementation for streaming protocols like RTMP. Another place where you might find relevant information is the related projects page of Netty.
I think the best way to solve it is to create a new Netty project and make a HTTP server and client, then modify it into a RTSP server and client.