-
Server side push
Hi all,
I have a project regarding network programming, and encountering a problem now.
The situation as follows:
I got a server program which make a server socket and listen to a dedicated/fixed port for clients connection. Suppose there is client connecting to our server, server will create a thread to serve for the client and sending data through the socket, It's seem find!!
Due to it is a real time system, we need to implement that the server will send out the same data every 1 mintue to all clients who are connected to the server. That mean all the clients should received the same data every 1 minute. So i think server side push technology should be implemented.
But I don't know how to broadcast the data to client in java, anyone can help?
many thanks!
-
Is it not possible to have a scenario where the client side has an applet that
sends requests to the server at specific intervals, indicating the clients latest update,
and the server side sends the latest update back if required ?
eschew obfuscation
-
Thanks sjalle first!
If clients make request to receive the data from our server, there will be a case that different clients receive different data. It is because it is a real time system, data may change in a short period(maybe 1 to 2 minutes), so suppose all the clients should make request at the same time, but it is difficult to ensure this.
Thanks again!!
-
Perhaps you need a fast connection, and if the clients need different data depending on:
- their last data exchange
- their user authentication
- the state of the info (from both sides)
you should have a 'housekeeping' system that track this info, you may need a
database, which I am sure you already have (according to your description).
I've done similar stuff (synchronizing a databse on a lan) but you will have to give
me more info so I can be more specific.
eschew obfuscation
-
Essentially, what your asking for is a multicast mechanism (broadcast messages to many clients). Have you looked at java.net.MulticastSocket?
-
iPush should meet your needs
 Originally Posted by Ahsai
Thanks sjalle first!
If clients make request to receive the data from our server, there will be a case that different clients receive different data. It is because it is a real time system, data may change in a short period(maybe 1 to 2 minutes), so suppose all the clients should make request at the same time, but it is difficult to ensure this.
Thanks again!!
Indeed, what you describe is a real time data distribution system. Such a system should be built with push technology.
I think iPush Server is what you need. It also supports J2ME for MIDP2.0 and Flash.
iPush Server
http://www.icetechnology.com/products/ipushv2/
The Vender's Site
http://www.icetechnology.com
They also provide demos developed with flash, you may surf their site and find them.
-
Are you the iPush spokesman. I think he wants to implement it himself...
http://java.sun.com/j2se/1.5.0/docs/...astSocket.html
When one sends a message to a multicast group, all subscribing recipients to that host and port receive the message (within the time-to-live range of the packet, see below). The socket needn't be a member of the multicast group to send messages to it.
When a socket subscribes to a multicast group/port, it receives datagrams sent by other hosts to the group/port, as do all other members of the group and port. A socket relinquishes membership in a group by the leaveGroup(InetAddress addr) method. Multiple MulticastSocket's may subscribe to a multicast group and port concurrently, and they will all receive group datagrams.
Currently applets are not allowed to use multicast sockets.
Can this be setup so only the server can send messages??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks