-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement UDP #5697
Implement UDP #5697
Conversation
@@ -1102,6 +1105,7 @@ export | |||
write, | |||
writecsv, | |||
writedlm, | |||
UdpSocket, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange. UDP is an acronym so shouldn't it be all caps UDPSocket
. (also, why is it TcpServer
, not TCPServer
, etc?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for more consistent use of caps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I did it for consistency with TCP, I'd vote for leaving this as is for this PR and then if we decide to rename, we can do that in one commit for both.
+1 for |
c_free(buf_addr) | ||
notify_error(sock.recvnotify,"Partial message received") | ||
end | ||
buf = pointer_to_array(convert(Ptr{Uint8},buf_addr),int(buf_size),true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use int(nread)
here and avoid the extra copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I suppose that's a good idea.
As I started this I guess I should give some input. I'm no expert, just a user, but having used this protocol for the same application in a few different languages (last one was go) here is what I would need. I've added the relevant code in go syntax.
I would just add that I believe its normal to do ones own management so I would not for example expect an error to be thrown if a packet is dropped nor get partial packets. I have sequence numbers in all packets so I detect dropped and out of sequence packets. I don't know if this is standard but it seems logical to me on an unreliable connection. --bob |
That is informative. I would still like to try raising an error by default and seeing how that goes. I suspect this doesn't happen much in practice. |
Alright, let's leave it like this then. |
Any updates on when this will get merged ? For what it's worth, i've been playing around with @loladiro's patch and it works great. |
As soon as somebody writes documentation and a few more tests. I'll get to it eventually, but am quite busy at the moment. Feel free to tackle that though. |
@loladiro sounds good, i'll see what i can do for some tests and documentation. |
Shall we merge it and open an issue for documentation and testing? Otherwise someone would have to make a pull request against your pull request... |
Why do I have a feeling that questionmark was rhetorical? ;) |
Yeah, I realized right after posting that I should just do it instead of suggesting it and waiting for someone else to do it. |
That's how things get done. |
I would do that with #3796, but somehow I feel that's how things get un-done. Unless someone else was to merge it, like Stefan did here... |
That's a little different – #3796 might break everything. This is quite safe as long as you don't use the new functionality and there's at least one report that the new functionality works nicely. |
But I am somewhat inclined at this point to just merge it and see what happens. |
Thanks for merging it, this will make things easier. |
Looks like I'm late to the party here, but I wanted to echo @Bob-C's comment above. I'm not a networking expert, but I've spent some time with UDP and implementing protocols on top of UDP, and I find it pretty surprising that the UDP API throws an exception on a partial packet instead of just dropping it. Unless you have what is, by non-HPC standards, a fairly exotic setup, packets are expected to get dropped all the time, and throwing an exception on some drops doesn't seem particularly helpful. And if if you have a lossless fabric with a setup that isn't expected to drop anything, it would be pretty unorthodox to use libuv or something that wraps libuv. |
@StefanKarpinski I figured it'd be faster if I did it myself. This needs some more tests and documentation (if you wouldn't mind taking care of that), but other than that this is good to go.