eklinger87 — 2013-12-03T12:10:12-05:00 — #1
To summarize: How do I post data to xml file on server AND update page with changes to xml file (maybe JSON) asynchronously?
Can anyone walk me though this or point me to someone or an example that would help?
fretburner — 2013-12-05T13:50:38-05:00 — #2
Hi, welcome to the forums!
That sounds like a really interesting and ambitious project you have there! I'd never heard of a Netburner server before, so I did a bit of googling and it appears to be some kind of module for interfacing electronic equipment with computers?
I managed to find a websockets library written in C, which might be of interest to your dev guy. One potential issue may be that the hardware is not up to the task of handling multiple websocket connections, but not knowing anything about the device I couldn't say.
If that's a no-go, another possible solution would be to set up a server to act as a middle-man - it would have to receive messages from the Netburner module, maintain websocket connections to all the clients, and relay any commands received from the clients back to the phone system.
pullo — 2013-12-07T08:24:55-05:00 — #3
Indeed it does
If the websockets option doesn't pan out, here's a reasonably good explanation of how you might go about implementing long polling.
Let us know how you get on.
eklinger87 — 2013-12-11T13:29:43-05:00 — #4
That's pretty much what I want to do. The question is how do I do it? If someone could just write up a functioning example of a button, that would be amazing.
If anyone can write that up for me, I could do the rest from there.
eklinger87 — 2013-12-11T13:32:55-05:00 — #5
fretburner — 2013-12-11T13:54:48-05:00 — #6
I noticed you mentioned using an XML file, and I see now that you'd mentioned it in your initial post, but how does XML fit into all of this?
eklinger87 — 2013-12-11T15:00:30-05:00 — #7
The XML file would be the database to store all the data between (middle-man). Eventually I would like the users to be able to chat browser to browser. If there's a better format, please let me know. Perhaps JSON? I'd have to figure that out.
fretburner — 2013-12-11T17:15:52-05:00 — #8
Writing to and from an XML file is probably not ideal.. files are the slowest way to read/write data. Any data wants to be passed immediately through from phone system to the client machines or vice-versa.
A lot depends on how much flexibility you have with the Netburner part of the equation. Is the software already written, and you've a fixed system to work with? Or is your C developer willing to work with you to come up with something that meets your requirements?
eklinger87 — 2014-01-07T19:04:15-05:00 — #9
Sorry, I was sidetracked with other projects. I'm working with a fixed system thats already written. I suppose the C developer would have to work to come up with something else that would support Node if we can't get it to work.