Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 117 users online: 7 members, 82 guests and 28 bots. Members: ACagliano, Ashbad, blue_bear_94, CalebHansberry, flyingfisch, HOMER-16. Bots: VoilaBot (3), Spinn3r (2), MSN/Bing (1), Magpie Crawler (4), Googlebot (17), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
Tom
Advanced Newbie

Joined: 20 Aug 2012 Posts: 48 Location: Greece
|
Posted: 20 Aug 2012 03:57:39 pm Post subject: Client-Server network? |
|
|
| Is it possible for one calculator to act as a server and the rest to be clients? Like one calculator uploads a text file to the main server and leaves, then 5 hrs later another one downloads it from the main server even after the original uploader left the network 5 hrs ago? |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55760 Location: Earth, Sol, Milky Way
|
Posted: 20 Aug 2012 04:01:46 pm Post subject: |
|
|
Tom, welcome to Cemetech! You should Introduce Yourself when you get a chance. To answer your question, yes, that's perfectly reasonable. In the current CALCnet/gCn systems, a computer program emulating a CALCnet client, by convention given the id 'AAAAAAAAAA', can provide services to the particular virtual hub. If you're dealing with a pure CALCnet network (ie, not connected to gCn), you could easily let one of the calculators be the server, periodically sending a broadcast identifying itself as the server. Clients could listen for those broadcasts to figure out which connected calculator was the server, then send direct put (send) or get (request) messages to that calculator. _________________
 |
|
| Back to top |
|
|
graphmastur
Power User

Joined: 27 Jul 2010 Posts: 464
|
Posted: 21 Aug 2012 08:34:34 am Post subject: |
|
|
| Why does the calculator have to identify itself as the server. Shouldn't any message being sent out automatically go to all of the calculators, and only the server responds? |
|
| Back to top |
|
|
merthsoft
File Archiver

Joined: 09 May 2010 Posts: 2735
|
Posted: 21 Aug 2012 08:59:58 am Post subject: |
|
|
| graphmastur wrote: | | Why does the calculator have to identify itself as the server. Shouldn't any message being sent out automatically go to all of the calculators, and only the server responds? | That's probably how I would do it. When the calc joins the network it sends out an "I need a server" packet, and the server responds with "oh! oh! That's me!". That way the client doesn't have to wait to get the "I'm a server" packet, and the server isn't broadcasting unnecessary stuff. _________________ Shaun |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55760 Location: Earth, Sol, Milky Way
|
Posted: 21 Aug 2012 10:18:35 am Post subject: |
|
|
Fair enough, I like that design too. If clients joined, on average, with lower frequency than the frequency of an "I am the server" broadcast, your design makes sense. If for some reason they joined at a higher rate, then it would generate more traffic (of course). And I think for something like this it's obvious the former scenario would be the realistic one. _________________
 |
|
| Back to top |
|
|
graphmastur
Power User

Joined: 27 Jul 2010 Posts: 464
|
Posted: 21 Aug 2012 12:22:20 pm Post subject: |
|
|
I don't think the server needs to send that out either. I mean honestly, to send stuff to the server, the client would say "I need to send something to the server" and the server would say "I'm a server, you can send it to me"
To receive stuff, it could say "I need this file from a server", and the server would say "I'm the server, and I have your file"
This way, no extra traffic is generated. |
|
| Back to top |
|
|
merthsoft
File Archiver

Joined: 09 May 2010 Posts: 2735
|
Posted: 21 Aug 2012 12:29:46 pm Post subject: |
|
|
| graphmastur wrote: | | I don't think the server needs to send that out either. | Send what out? There should be some sort of handshake/negotiation. Look at TCP, it does the SYN,SYN/ACK,ACK thing, but that's because it already knows the endpoints. Before that there's a broadcast and IP negotiation and all sorts of stuff under the hood that the calcs don't provide, so for the sake of sanity, you want some sort of "I need a server" "Ok, that's me" "Great, here's the stuff" thing. Obviously you don't need it, you can just have "Here's my stuff", but it makes more sense to give it to the server directly. That's the whole point of handshakes in networking.
It also makes the protocol a little more flexible because you can later add negotiations to the handshake etc. That's why people tend to leave reserved byes in their protocols (especially in the handshake--DICOM has 32 bytes of 0 in a row... I hate DICOM), they can then add on more if they need to. _________________ Shaun |
|
| Back to top |
|
|
graphmastur
Power User

Joined: 27 Jul 2010 Posts: 464
|
Posted: 22 Aug 2012 01:06:01 am Post subject: |
|
|
| I understand that. I was just saying that the server didn't have to announce itself directly when a calc joined each and every time. Especially if there's a chance the server could disconnect. |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55760 Location: Earth, Sol, Milky Way
|
Posted: 22 Aug 2012 09:11:01 am Post subject: |
|
|
| graphmastur wrote: | | I understand that. I was just saying that the server didn't have to announce itself directly when a calc joined each and every time. Especially if there's a chance the server could disconnect. | But he's not suggesting the server announce it directly. He's suggesting that when a server sees a broadcast "any servers here?" it respond with a direct (one-to-one/point-to-point) message "yes, I'm a server, and here is what I can do for you." _________________
 |
|
| Back to top |
|
|
graphmastur
Power User

Joined: 27 Jul 2010 Posts: 464
|
Posted: 22 Aug 2012 04:48:26 pm Post subject: |
|
|
| KermMartian wrote: | | graphmastur wrote: | | I understand that. I was just saying that the server didn't have to announce itself directly when a calc joined each and every time. Especially if there's a chance the server could disconnect. | But he's not suggesting the server announce it directly. He's suggesting that when a server sees a broadcast "any servers here?" it respond with a direct (one-to-one/point-to-point) message "yes, I'm a server, and here is what I can do for you." |
Ah, okay. I misunderstood. i had thought he meant that it was whenever a calc joined, he would determine the server first, not when he actually needed data. |
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
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 You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.032909 seconds.
|