Make sendmsg in AsyncUDPSocket overridable
authorYang Chi <yangchi@fb.com>
Mon, 31 Jul 2017 20:48:23 +0000 (13:48 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 31 Jul 2017 20:53:14 +0000 (13:53 -0700)
commit53b24a320c88077fe80ff1359e74d59ccbd8d8a9
treeaf37a73eba185b88cb03efd6f5b299f189672c97
parente74ceef6f9d10b3369756904d30ec423081cd931
Make sendmsg in AsyncUDPSocket overridable

Summary: Add a protected virtual sendmsg method to AsyncUDPSocket. And make it default to call the system sendmsg function. This enables subclasses of AsyncUDPSocket to be able to override the behavior of sendmseg, also makes AsyncUDPSocket easier to mock and test.

Reviewed By: afrind

Differential Revision: D5459745

fbshipit-source-id: b0227bf7503b1096cb1f0bfc8b9c784db2f2e45d
folly/io/async/AsyncUDPSocket.cpp
folly/io/async/AsyncUDPSocket.h
folly/io/async/test/AsyncUDPSocketTest.cpp