Sign in to follow this  

Networking live data

This topic is 4112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys - this is a great website, so I will fire off my first ever question here. Can someone please explain what sofware and hardware is required for live real-time transfer of data. For example if in a game through some middleware you want to broadcast a change in an item, how can this be achieved? I guess this will relate closely to how share prices are shown in real time, what technology is used to do this? Thanks for your help.

Share this post


Link to post
Share on other sites
Just straight up network programming. google around for sockets and/or look around in the articles & resources section of this site in the network programming section

As for hardware:
connection to the internet (at least one party must have a static IP address, generally the server).

For a better response, what specifically are you trying to implement?

-me

Share this post


Link to post
Share on other sites
Hi thanks for your reply. Well basically I am actually wanting to implement live changes in betting prices. So for example using an application I change the odds for a certain horse from 2.0 to 2.2 I want this change to reflect on the website straight away.

So I guess I will use sockets as a channel to pass the data from the app to the website and then use AJAX or JSON to make the change on the website?

Share this post


Link to post
Share on other sites
This is a more complicated question that you think, especially because it sounds like money may be involved. Let me first see if I understand your basic architecture.

On one end, you have a client using a web browser to view some website that shows odds on horses and may allow them to do something with those odds, like place a bet.

On the other end, you've got a program that is generating or retrieving those odds from somewhere else.

In the middle, you've got some sort of web server.

Now, there are lots of ways to accomplish what you want, depending on how often your odds change, whether you allow the user to interact with them, etc. If they only change every hour or so, and they're static values, you could just have your program periodically write to a text file which is included as part of the web data you're sending.

If the client is able to actually DO something with those odds, like perhaps place a bet, you'll need a much bigger solution. You may want to look into databases and using them to run websites. Could you elaborate on what you're trying to accomplish?

Share this post


Link to post
Share on other sites
Scenario 1

The trader updates odds for a certain runner because it appears to have an advantage so the odds go from 2.0 to 3.0.
This change is made within an application and the update is sent to the db which then updates the website. This has to be instantaneous.


Scenario 2

In a totally different model to scenario 1, the punters can set their own odds on the website. A punter sets his own odds and submits the bet.
The bet is logged into the db and then the placed bet is thrown back onto the website for someone to match. Has to be in a split second.


Scenario 3

Since these odds change, i would like to create a real-time graph plotting these odds changes as they happen. Has to be spot on.


To top this off the above scenarios have to be broadcast to a multiple of platforms, such as mobiles etc.



So what hardware do I need and what software.

Someone suggested using data broadcast technology, need more info really.


Thanks

Share this post


Link to post
Share on other sites
Seems to me the best way is to just create a website for the job. I don't think you need another seperate application to update the website.

Have your website setup, with some sort of DB, and an admin pannell where odds can be added/changed/deleted at will.

The user placed bets would be part of the same system but open to anyone. Unless you already have some other piece of software with your current odds on it which you want to automatically update your site its easier just to keep it all up there. Any changes made via the admin pannell to the DB would be instantly avaliable, and it would allow you to update it from anywhere you had a webconnection.

If your looking todo it yourself then look into writing a php website with a MySQL database - its all free and relativly easy to use (as compared to writing your own windows sockets app which can be a pain in the ass!). You'd need sessions as well for access control but thats it. It wouldn't be too hard to write for someone who's done that type of web development befor, however if your totally new to programming etc it'd probably be a bit much to expect to write it all yourself first off. However if your really into it then its definatly doable! Just be ready for a bit of frustration along the way as you get your head around it all :P

Share this post


Link to post
Share on other sites
Yeah, ok, Champion, that sounds like you're looking to write a serious web application. There are alot of design hurdles you'll have to carefully consider. There will be all sorts of questions, like "if I told someone certain odds, and they think for a minute and then register a bet with those odds, but in that minute, the odds changed, should I recognize that bet?"

For a live graph, you will need to constantly be pushing information to the client, which is a tad tricky. You might want to do that with a Java applet, since doing it with AJAX would be rather complicated.

Probably at the core of your system (unless you go REALLY big) will be a cgi script that a client can call to get the odds. Once you write that script, the other pieces can depend on it. Still, this sounds like a complicated project; you may need help from someone more experienced with these problems. Although you'll probably eventually be able to get most of it done on your own, some really good design decisions early on will save you a lot of effort later.

Share this post


Link to post
Share on other sites
Hi thanks for your replies.

About the betting question:

If you gave a punter certain odds and then he/she thought about it for a minute and the odds did not change and then submitted the bet; the bet would be placed at those odds.

If you gave a punter certain odds and then he/she thought about it for a minute and the odds were changed by you, the punter would instantaneously have the new price update on his screen. The bet would be placed at the new odds.

Share this post


Link to post
Share on other sites

This topic is 4112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this