Documentation ¶
Index ¶
- Variables
- func Dial(network, address string) (c net.Conn, err error)
- func Listen(network, address string) (net.Listener, error)
- type Dialer
- type PerfMonData
- type UDTAddr
- type UDTConn
- func (fd UDTConn) Close() error
- func (fd UDTConn) LocalAddr() net.Addr
- func (fd UDTConn) PerfMon(clear bool) (*PerfMonData, error)
- func (fd UDTConn) Read(buf []byte) (int, error)
- func (fd UDTConn) RemoteAddr() net.Addr
- func (fd UDTConn) SetDeadline(t time.Time) error
- func (fd UDTConn) SetReadDeadline(t time.Time) error
- func (fd UDTConn) SetRendezvous(value bool) error
- func (fd UDTConn) SetWriteDeadline(t time.Time) error
- func (fd UDTConn) Write(buf []byte) (writecnt int, err error)
- type UDTListener
Constants ¶
This section is empty.
Variables ¶
var ( // UDP_RCVBUF_SIZE is the default UDP_RCVBUF size. UDP_RCVBUF_SIZE = uint32(20971520) // 20MB // UDT_SNDTIMEO is the udt_send() timeout in milliseconds // note this doesnt change the interface, we use it as a poor polling UDT_SNDTIMEO_MS = C.int(UDT_ASYNC_TIMEOUT) // UDT_RCVTIMEO is the udt_recv() timeout in milliseconds // note this doesnt change the interface, we use it as a poor polling UDT_RCVTIMEO_MS = C.int(UDT_ASYNC_TIMEOUT) // UDT_ASYNC_TIMEOUT (in ms) UDT_ASYNC_TIMEOUT = 40 )
var INVALID_SOCK C.UDTSOCKET = C.UDTSOCKET(C.INVALID_SOCK)
rebind this here for type safety
Functions ¶
func Dial ¶
Dial connects to the remote address raddr on the network net, which must be "udt", "udt4", or "udt6". If laddr is not nil, it is used as the local address for the connection.
func Listen ¶
Listen listens for incoming UDT packets addressed to the local address laddr. Net must be "udt", "udt4", or "udt6". If laddr has a port of 0, ListenUDT will choose an available port. The LocalAddr method of the returned UDTConn can be used to discover the port. The returned connection's ReadFrom and WriteTo methods can be used to receive and send UDT packets with per-packet addressing.
Types ¶
type Dialer ¶
type PerfMonData ¶
type PerfMonData struct { // global measurements MsTimeStamp int64 // time since the UDT entity is started, in milliseconds PktSentTotal int64 // total number of sent data packets, including retransmissions PktRecvTotal int64 // total number of received packets PktSndLossTotal int // total number of lost packets (sender side) PktRcvLossTotal int // total number of lost packets (receiver side) PktRetransTotal int // total number of retransmitted packets PktSentACKTotal int // total number of sent ACK packets PktRecvACKTotal int // total number of received ACK packets PktSentNAKTotal int // total number of sent NAK packets PktRecvNAKTotal int // total number of received NAK packets UsSndDurationTotal int64 // total time duration when UDT is sending data (idle time exclusive) // local measurements PktSent int64 // number of sent data packets, including retransmissions PktRecv int64 // number of received packets PktSndLoss int // number of lost packets (sender side) PktRcvLoss int // number of lost packets (receiver side) PktRetrans int // number of retransmitted packets PktSentACK int // number of sent ACK packets PktRecvACK int // number of received ACK packets PktSentNAK int // number of sent NAK packets PktRecvNAK int // number of received NAK packets MbpsSendRate float64 // sending rate in Mb/s MbpsRecvRate float64 // receiving rate in Mb/s UsSndDuration int64 // busy sending time (i.e., idle time exclusive) // instant measurements UsPktSndPeriod float64 // packet sending period, in microseconds PktFlowWindow int // flow window size, in number of packets PktCongestionWindow int // congestion window size, in number of packets PktFlightSize int // number of packets on flight MsRTT float64 // RTT, in milliseconds MbpsBandwidth float64 // estimated bandwidth, in Mb/s ByteAvailSndBuf int // available UDT sender buffer size ByteAvailRcvBuf int // available UDT receiver buffer size }
type UDTAddr ¶
type UDTAddr struct {
// contains filtered or unexported fields
}
func ResolveUDTAddr ¶
func WrapUDPAddr ¶
type UDTConn ¶
type UDTConn struct {
// contains filtered or unexported fields
}
UDTConn is the implementation of the Conn and PacketConn interfaces for UDT network connections.
func DialUDT ¶
DialUDT connects to the remote address raddr on the network net, which must be "udt", "udt4", or "udt6". If laddr is not nil, it is used as the local address for the connection.
func (UDTConn) PerfMon ¶
func (fd UDTConn) PerfMon(clear bool) (*PerfMonData, error)
func (UDTConn) RemoteAddr ¶
func (UDTConn) SetDeadline ¶
func (UDTConn) SetReadDeadline ¶
func (UDTConn) SetRendezvous ¶
func (UDTConn) SetWriteDeadline ¶
type UDTListener ¶
UDTListener is a network listener for UDT.
func ListenUDT ¶
func ListenUDT(network string, laddr *UDTAddr) (*UDTListener, error)
ListenUDT listens for incoming UDT packets addressed to the local address laddr. Net must be "udt", "udt4", or "udt6". If laddr has a port of 0, ListenUDT will choose an available port. The LocalAddr method of the returned UDTConn can be used to discover the port. The returned connection's ReadFrom and WriteTo methods can be used to receive and send UDT packets with per-packet addressing.
func (*UDTListener) Addr ¶
func (l *UDTListener) Addr() net.Addr
func (*UDTListener) Close ¶
func (l *UDTListener) Close() error