It's UWAweek 47

help3002

This forum is provided to promote discussion amongst students enrolled in CITS3002 Computer Networks.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message. How do I ask a good question?

Displaying the 9 articles in this topic
Showing 9 of 503 articles.
Currently 36 other people reading this forum.


 UWA week 19 (1st semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
6:27pm Thu 9th May, ANONYMOUS

Can we pass on the names of the neighbours in command line along with the IP:port or is this not allowed


SVG not supported

Login to reply

👍?
helpful
6:42pm Thu 9th May, Christopher M.

ANONYMOUS wrote:
> Can we pass on the names of the neighbours in command line along with the IP:port or is this not allowed
Not permitted, because it's not what is specified on the project sheet, and will prevent your project from being tested using some common scripts. It's trivial to first send a datagram to each of your neighbours, telling them your name.


SVG not supported

Login to reply

👍?
helpful
12:01am Fri 10th May, ANONYMOUS

"Christopher McDonald" <ch*i*.*c*o*a*d@u*a*e*u*a*> wrote:
> ANONYMOUS wrote: > > > Can we pass on the names of the neighbours in command line along with the IP:port or is this not allowed > > Not permitted, because it's not what is specified on the project sheet, > and will prevent your project from being tested using some common scripts. > > It's trivial to first send a datagram to each of your neighbours, telling them your name.
I'm attempting to do this exact thing where as the station starts up it sends its name to all its neighbours (before any requests are made), then in the main server loop with select() each station picks up on neighboring station's names. But for me I'm having issues where not all the names come back, and instead only some of them do. Some others are just not received and I'm unsure as to why that would be happening even though the select() function is present and should be able to handle the availability of sockets for when they are readable. The number of names which come back is also different every time the stations are run, which is making me think that maybe the issue lies with the blocking nature of receiving datagrams (despite select()) Would you know why this is occuring?


SVG not supported

Login to reply

👍?
helpful
3:11am Fri 10th May, Christopher M.

ANONYMOUS wrote:
> I'm attempting to do this exact thing where as the station starts up it sends its name to all its neighbours (before any requests are made), then in the main server loop with select() each station picks up on neighboring station's names. But for me I'm having issues where not all the names come back, and instead only some of them do. Some others are just not received and I'm unsure as to why that would be happening even though the select() function is present and should be able to handle the availability of sockets for when they are readable.
One possibility - if you're starting all of your station servers from a script then, when one of them transmits that first 'hello' datagram, its destination server might not have started yet. The datagram is transmitted, but there's no server at the destination host and port there to receive it. Try - before transmitting your first datagram, sleep(2) to give all servers a chance to start. ??


SVG not supported

Login to reply

👍?
helpful
9:27am Fri 10th May, ANONYMOUS

Hmm, I tried that and it didn’t seem to work


SVG not supported

Login to reply

👍?
helpful
10:50am Fri 10th May, Christopher M.

ANONYMOUS wrote:
> Hmm, I tried that and it didn’t seem to work
I appreciate that no-one likes the phrase, but "it works for me" : create/bind to your TCP and UDP sockets sleep(2) transmit a 'hello' datagram to your neighbours enter your select() loop ..... receive 'hello' datagrams from neighbours


SVG not supported

Login to reply

👍?
helpful
10:54am Fri 10th May, Christopher M.

Sorry, forgot to add - I don't use the station names for anything, other than naming the final destination station, and to help with debug printing.


SVG not supported

Login to reply

👍?
helpful
2:56pm Fri 10th May, ANONYMOUS

Yeah, my code is near identical to that format and it was not working, I added a timeout into the select() of 10s and now it gets the neighbours every time (with almost no change to the actual time to get all the names - near instant)


SVG not supported

Login to reply

👍?
helpful
4:19pm Fri 10th May, Christopher M.

ANONYMOUS wrote:
> Yeah, my code is near identical to that format and it was not working, I added a timeout into the select() of 10s and now it gets the neighbours every time (with almost no change to the actual time to get all the names - near instant)
Glad that something's working for you, though I can see how allowing the select() call to unblock after 10sec would help the datagrams arrive. It sounds like you don't have all the important descriptors set in your readset.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy