EJb, direct ServerSocket or any other implementation - java

I am working on a Chatting Website project which will provide similar features as was like yahoo messenger with chat rooms...
Where multiple clients will connect to the central server and chatting(communication) and file sharing(if possible) will take place.
Now i did a bit of research and i came out with the following choices:
For the client i will use either Winforms or WPF with c#
And for server I am confused between,
Direct Servesocket based application to be deployed on a VPN or a dedicated server,
or EJB based something,
Or any other technology as you may suggest to be suitable for this.
kindly keep somethings in mind:
1. It should be scalable enough to be able to sustain 100 - 1000 to 1,00,000 clients
2. Server should also serve android app as client end.
3. Deployment details also requested

Related

Web Server vs. Socket Server for android app

After a lot of research i am more confused then before on what kind of server to use for an android app.
My question in a nutshell is: which kind of server is easier to use and deploy.
I want to create an android application that communicates with a server to find other clients, the server uses GCM to notify other clients that one client wants to communicate and is used to exchange the address of the clients. Afterwards the clients should be able to communicate directly to one another.
What i found out is that from the android point of view either would be fine, both is likewise possible and neither produces more work then the other.
On the server side it looks like web service would be better to use, because it is easier to find a server provider. I might be wrong here but it looks like most large server providers don't like to give you enough access to run a jar file.
Google and amazon offer servers that can host web services, i am not sure if a socket server would be possible there, so if anyone can give me some tips on good and affordable server providers i would also like to have some insight there.

WebRTC Server Java implementation

I am starter in WebRTC , I want to create simple application with call, but i can not understand what is the server? Is the WebSocket enough? or I need other server?
my scenario is very simple two chrome users A and B, A call B
It depends on your application but you probably want to use server for signaling. The browsers are after establishing session connected peer-to-peer. (it isn't going through your server)
For more detail http://www.html5rocks.com/en/tutorials/webrtc/basics/.
Agree you will probably need a server for signaling. My company OnSIP offers a hosted solution for this, so you would not need to manage servers, but whether you decide to or not - here is an explainer vid on signaling & why you'll need it. Rather than write an explanation here, I'm just going to link it:
https://www.youtube.com/watch?v=-waKd_edBGw
Also, if you intend to run an application that reliably sets up calls 90%+ time, you'll also need media relay (TURN) servers. This is to handle NAT and firewall traversal, which can mess with P2P call setup in real life networking situations as the endpoints have private IP addresses. Media relay servers have a public IP address and literally relay the media stream. These require a lot of bandwidth to run— I don't believe any cloud hosting service will suffice. Again, my company offers this as part of a hosted solution with simple APIs. It is doable to do this all on your own.
Competitive services that handle signaling & media relay & provide developer APIs: EasyRTC & TokBox.

Real-time web service java using axis2

Purpose:
I'm trying to make a real-time web service in Java. When there're changes in database, the data in clients(probably Android client) will be changed automatically without refreshing.
Platform:
I'm using Tomcat 7 container and Axis2.
Problems:
I'm stuck in the way to approach. I've realized that there were 2 ways:
1. When the data in server changes, notice to all the clients. Web-service allows us to do this, but I don't know what clients I have to inform!
2. Clients connect to the server, keep the connection alive and whenever there's a change, update data. However, if the client is the handheld, it will consume much power and data exchange over 3G network.
I know that's a complicated problem. So I just want to ask if there is an efficient way to approach? And if possible, anyone can give me one example of realtime web service like this?
I've searched over many pages, but nothing's helpful. Can anyone give me some suggestions? Tkx!
Is it a requirement to use webservices or Axis? Otherwise, you might be interested in WebSockets. These are connections over plain HTTP that provide two way communication. Your clients will connect to your server, and as soon as new data is available your server can push data to every connection it knows of, thus informing all clients that are connected.

Low Latency communication using web sockets & Java Server

I'm looking to establish a low latency 2way communication between a javascript interface (client) and a java server.
The client has to request data from the server (can ask for different set's of data, needs to be async, data are small sets of sensor data).
I was thinking of implementing this using websockets because of it's low latency. However I'm stuck at choosing a java websocket server implementation (I found jetty but there are so many, and there is also a case to be made for node.js and socket.io but there are not going to be a lot of clients in this case; just one client sending multiple requests so correct me if i'm wrong but there doesn't seem to be a reason for going the node.js path).
Last but not least; the server is running on a raspberry pi and is recieving it's sensor data over a special protocol; (but i don't think that's important for this question).
Is there anyone with some experience in this field and wants to share his/her toughts? Thx.
I've been using Kaazing (HTML5 edition) to proxy traffic received via a web-socket to a Java process listening on a traditional TCP server socket.
It's working well, latency is low and was consistently handling over 1000 messages/second (though we found our Java code was the limiting factor in that respect).
Kaazing also provides client APIs for Java, JavaScript and Flex, which allowed us to write an acceptance test suite using the familiar APIs (Concordion in my case).
I don't know how well it'd run on a Raspberry Pi, but given it's free to download there's a simple way to find out.
I've solved my problem by using Atmosphere which is a framework that provides compatibility to all major java servers and web browsers. (The Java Official Standard is still in the workings).
https://github.com/Atmosphere/atmosphere
I've got the chat demo up and running.

Running java server application 24/7 and secrets behind all those famous online live apps

I'm currently building an application that is about VOIP / random chatting, which is similar to skype or chatroullet. My question is extension to this
https://stackoverflow.com/questions/11384155/running-java-server-application-24-7-not-on-local-machine
I've been experimenting and playing around with TCP / UDP sockets and now I have ability to build VOIP / instant chatting applications. But as you might already know, in order for data transmission between client to client or client to server, the server application has to be powered on (in other word, be online) and be accessible by client applications. The problem is that, I'm not living by my self but with my family, which I can't simply use one of my computer to run my server application for 24/7 mainly due to the electricity bills and my lack of knowledge about the networking concerns me about the security, because I had to go through some configuration / port forwarding on my current router in order to make the protocol accessible by other users outside of my local network. So my biggest question is that, how do people or developers normally have been dealing with this kind of situations? Have they been simply using their own computer to run the server application? or have they purchased an external machine to run the server application
===========================================
Additional question:
Is TCP / UDP socket the only way of making applications such as MMO, VOIP and instant chatting programs?
i see that your topic was closed in the previous thread. I think such questions are unrelated to stackoverflow.
However, i would like to give you a glimpse of what is happening to most of us who own / make Java Web Applications. I used to work in a datacenter for a year and a half. Java applications are a little harder to put online as they require resources that not many data centres are willing to invest time and support in. Other than that, they are pretty much as straightforward as normal PHP applications.
You will need the standard options like Colocation, Dedicated Server, VPS, Cloud Virtual Machine, or a shared tomcat / application server hosting.
Colocation is where you put your own purchased and configured server with the data center, you have complete ownership of the server, nobody can touch it unless permitted by yourself. You pay to put your server into the data center, and are in charged of anything that happens within the server, including OS patch.
Usually servers in data centers (due to size constraint) come in rack units. 1U refers to 1 rack space, usually this is equivalent to one PC, although a server is much more powerful. In Singapore, the charges per U is SG$200.
Dedicated server is where you lease a server from the data center. The server is managed by the data center and can be as powerful as you want it to be. OS updates, installations, service guarantees are provided by the data center.
VPS is having a fraction of a server resource, but many challenge that you do not have the "root" access to the server in most cases.
Cloud is the virtualization of the entire operating system. If this was Linux, you would have the root access to it. Many of us now are going for this option because of its scalability. Some data centers may use popular virtualization hypervisors like VMware ESXi, Microsoft Hyper V.
The list above is represented from the most expensive to the least. Of course, that is depending on your location and service provider.
Hardly anybody i know tries to put a running server at home, it is a fire hazard itself, you will not know when your electricity will be cut off, standard dedicated bandwidth would as expensive.
Hosting with a data center would be much cost efficient and safer in my opinion.
EDIT:
Is TCP / UDP socket the only way of making applications such as MMO, VOIP and instant chatting programs?
Have you looked at HTML 5 Web Sockets, or any AJAX based framework for this?
Try searching the web for cloud hosting. For example, Heroku, AWS and many others provide a hosted service. That is what people use to host their service and it is more cost effective than trying to maintain something yourself.
Are you writing an Android application for it as well? Just as an aside you might want to make use of this ARO tool to ensure you are using the network efficiently. http://developer.att.com/developer/legalAgreementPage.jsp?passedItemId=9700312

Categories