-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
!act #13490 Changed the callback to SocketOption to accept a channel instead of a Socket, this allows for using the nio features. #15568
Conversation
Can one of the repo owners verify this patch? |
Thanks for rebasing! OK TO TEST |
PLS BUILD |
Pull request validation: SUCCESS 👍 |
Thanks for the rebase. Could you squash to one commit? |
Squashed. |
@@ -13,19 +13,38 @@ object Inet { | |||
*/ | |||
trait SocketOption { | |||
|
|||
def beforeDatagramBind(ds: DatagramSocket): Unit = () | |||
/** | |||
* Action to be taken for this option before bind is called() |
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.
Parentheses are on the wrong word. Also same with next two methods.
LGTM, after minor nitpicks. |
Since this is breaking |
Updated migration guide. |
LGTM |
1 similar comment
LGTM |
I just noticed that commit message mentions issue number from assembla. Could you change it to #13490 and then we can merge. |
…nel instead of a Socket, this allows for using the nio features. For example in Java 7 you can now join a multicast group: case class JoinGroup(group: InetAddress, networkInterface: NetworkInterface) extends SocketOption { override def afterConnect(c: DatagramChannel): Unit = { c.join(group, networkInterface) } } IO(Udp) ! Udp.Bind(self, new InetSocketAddress(MulticastListener.port), options=List(ReuseAddress(true), JoinGroup(MulticastListener.group, MulticastListener.interf))) Other minor changes: - changed all methods in SocketOption to take a Channel instead of a Socket. The socket can be gotten from the Channel but not the reverse. - all methods that are called before the bind are now called beforeBind for consistency. - All network connections now call the beforeBind and afterConnect.
!act #13490 Changed the callback to SocketOption to accept a channel instead of a Socket, this allows for using the nio features.
Changed the callback to SocketOption to accept a channel instead of a Socket, this allows for using the nio features.
For example in Java 7 you can now join a multicast group: