Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 12, 2018 10:12 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Interesting Question About Broadcasting and WAN Networking
PostPosted: Tue Mar 30, 2010 5:59 pm 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
I enable my software to run in a networked environment by allowing the user to select a database on the fly, which can reside on a shared volume, an iDisk, a Dropbox folder, or anything else recognized by the Mac OS X file system.

When changes are made in a networked environment, the computer that made the change sends a broadcast to all connected users via a UDPSocket. This broadcast triggers all connected machines to refresh the data that was changed (re-reading it from the database, which was changed by the first machine). All of this works great over a LAN, but the UDPSocket cannot send these broadcasts to users in different geographical locations accessing a shared network via Dropbox.

I've toyed around with several ideas, but I'm not really sure what the solution here is. I must admit my networking and socket knowledge is minimal, so any feedback about this would be most appreciated.

Happy to further explain things if they need clarification.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Wed Mar 31, 2010 10:36 am 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
Broadcasts aren't normally sent outside the LAN. Imagine how many packets would be traversing the Internet if routers blindly allowed broadcasts. Imagine the flood of responses too. :shock:

I'd look at having each client 'register' with the server. When data changes, instead of broadcasting, the server would send responses to each 'registered' client using its address.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Wed Mar 31, 2010 11:43 am 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
so does this then mean i will probably be creating a separate server application as well?

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Wed Mar 31, 2010 12:19 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
Once you get outside your LAN you can't rely on a broadcast address.

You could use a server, or you could have the clients poll the DB for changes, perhaps something as simple as the DB file modification date. Maybe somebody has a better idea. I'm not a DB guy.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Wed Mar 31, 2010 12:22 pm 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
hmm, that's an interesting idea. somewhat unreliable though - i've seen those modification dates be very inaccurate, or not update correctly every time.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Thu Apr 01, 2010 10:57 am 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
Where are all the DB gurus?

How about setting an entry in the DB itself? Maybe the last time it was updated, and by which client.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Thu Apr 01, 2010 11:50 am 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
i know, i would really love some help here. does no one honestly have a solution to this?

what i'm thinking now is saving a file in the dataset that basically means "an update has been made", with an internal sequential number. the app would periodically check that file and compare its sequential number to its internal "last updated" number. if there is a new update, it will re-read the specified data based on what's in the file, and then update its internal update number so it won't update again until the file is changed again and updated with a higher number.

this seems like it may work, though it's not very elegant and seems there is a lot of room for error and problems.

does someone, anyone, have any ideas regarding this topic? thank you!

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Thu Apr 01, 2010 11:52 am 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
also - in this WAN setup, i will have users from all over the globe using my software - japan, italy, france, austria, new zealand, australia, new york, etc. etc - so the date modified variable becomes very hard to use and keep track of globally because of all of the massive time differences. that's why i'm using a sequential number rather than a time/date stamp.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Thu Apr 01, 2010 11:27 pm 
Offline

Joined: Tue Oct 18, 2005 5:19 pm
Posts: 3
Your application as described has larger problems than update notification. There seems to be a misunderstanding as to how Dropbox works. It doesn't bridge networks together, it synchronizes files to the Dropbox servers.

This is fast but it isn't instant. Imagine two users altering records in your database at the same time. One person will "win" and the other will "lose". Only one of the changes will be committed:
https://www.dropbox.com/help/36

Note that these conflicts occur on the file level, not the database record level. So in a conflict, if User A has altered five records and User B has altered five different records, all of User B's changes will be lost.

I would recommend either writing the server-side in PHP/MySQL or using a database server and connecting to it via REALbasic.

Navdeep Bains


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Thu Apr 01, 2010 11:52 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
A file based solution wont work well for the reasons noted.

I'm pretty sure that you're going to need some kind of server.

Some database servers (PostgreSQL, OpenBase) have change notifications so you can tell what got changed, deleted, updated etc and each client can decide what to do with these notifications.

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Fri Apr 02, 2010 12:45 am 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
i know all of this but i'm not using database records and individual files are accessed at different times. each connected person is working on their own file, so overwriting data is a non-issue.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Interesting Question About Broadcasting and WAN Networki
PostPosted: Tue Jun 14, 2011 4:39 pm 
Offline

Joined: Fri May 08, 2009 1:42 am
Posts: 71
nbains wrote:
Navdeep Bains


Hi Navdeep,

Could you consider putting your FtpKit 1.7 back up for sale as is, or put it out for public domain under the GPL if you have no intentions of developing it further. I have found it is very useful for FTPing files and is very lightweight to add to the project. I would love to be able to puchase it, but your web site no longer allows you to purchase it or get the zip file as of a couple of weeks ago.

Thanks
Merv


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group