diff --git a/mock_batch_conn_test.go b/mock_batch_conn_test.go index e3e0db676..740329000 100644 --- a/mock_batch_conn_test.go +++ b/mock_batch_conn_test.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: conn_oob.go +// Source: sys_conn_oob.go // Package quic is a generated GoMock package. package quic diff --git a/conn.go b/sys_conn.go similarity index 81% rename from conn.go rename to sys_conn.go index 811279c98..4b38b0634 100644 --- a/conn.go +++ b/sys_conn.go @@ -10,6 +10,7 @@ import ( "github.com/lucas-clemente/quic-go/internal/utils" ) +// connection is a connection that allow reading of a receivedPacket. type connection interface { ReadPacket() (*receivedPacket, error) WritePacket(b []byte, addr net.Addr, oob []byte) (int, error) @@ -17,7 +18,8 @@ type connection interface { io.Closer } -// If the PacketConn passed to Dial or Listen satisfies this interface, quic-go will read the ECN bits from the IP header. +// OOBCapablePacketConn is a connection that allows the reading of ECN bits from the IP header. +// If the PacketConn passed to Dial or Listen satisfies this interface, quic-go will use it. // In this case, ReadMsgUDP() will be used instead of ReadFrom() to read packets. type OOBCapablePacketConn interface { net.PacketConn @@ -50,6 +52,11 @@ func wrapConn(pc net.PacketConn) (connection, error) { return newConn(c) } +// The basicConn is the most trivial implementation of a connection. +// It reads a single packet from the underlying net.PacketConn. +// It is used when +// * the net.PacketConn is not a OOBCapablePacketConn, and +// * when the OS doesn't support OOB. type basicConn struct { net.PacketConn } diff --git a/conn_df.go b/sys_conn_df.go similarity index 100% rename from conn_df.go rename to sys_conn_df.go diff --git a/conn_df_linux.go b/sys_conn_df_linux.go similarity index 100% rename from conn_df_linux.go rename to sys_conn_df_linux.go diff --git a/conn_df_windows.go b/sys_conn_df_windows.go similarity index 100% rename from conn_df_windows.go rename to sys_conn_df_windows.go diff --git a/conn_helper_darwin.go b/sys_conn_helper_darwin.go similarity index 100% rename from conn_helper_darwin.go rename to sys_conn_helper_darwin.go diff --git a/conn_helper_freebsd.go b/sys_conn_helper_freebsd.go similarity index 100% rename from conn_helper_freebsd.go rename to sys_conn_helper_freebsd.go diff --git a/conn_helper_linux.go b/sys_conn_helper_linux.go similarity index 100% rename from conn_helper_linux.go rename to sys_conn_helper_linux.go diff --git a/conn_generic.go b/sys_conn_no_oob.go similarity index 100% rename from conn_generic.go rename to sys_conn_no_oob.go diff --git a/conn_oob.go b/sys_conn_oob.go similarity index 100% rename from conn_oob.go rename to sys_conn_oob.go diff --git a/conn_oob_test.go b/sys_conn_oob_test.go similarity index 100% rename from conn_oob_test.go rename to sys_conn_oob_test.go diff --git a/conn_test.go b/sys_conn_test.go similarity index 100% rename from conn_test.go rename to sys_conn_test.go diff --git a/conn_windows.go b/sys_conn_windows.go similarity index 100% rename from conn_windows.go rename to sys_conn_windows.go diff --git a/conn_windows_test.go b/sys_conn_windows_test.go similarity index 100% rename from conn_windows_test.go rename to sys_conn_windows_test.go