Documentation ¶
Index ¶
- func EnableDebugLogs(enable bool)
- func JoinHostPort(host, port string) string
- func ResetDropPercent()
- func SetClientReadDropPercent(p int)
- func SetClientWriteDropPercent(p int)
- func SetMsgLengtheningPercent(p int)
- func SetMsgShorteningPercent(p int)
- func SetReadDropPercent(p int)
- func SetServerReadDropPercent(p int)
- func SetServerWriteDropPercent(p int)
- func SetWriteDropPercent(p int)
- func SplitHostPort(hostport string) (host, port string, err error)
- type TemporaryMessage
- type UDPAddr
- type UDPConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableDebugLogs ¶
func EnableDebugLogs(enable bool)
EnableDebugLogs has log messages directed to standard output if enable is true.
func JoinHostPort ¶
JoinHostPort behaves the same as the net.JoinHostPort function.
func SetClientReadDropPercent ¶
func SetClientReadDropPercent(p int)
SetClientReadDropPercent sets the read drop percent for clients.
func SetClientWriteDropPercent ¶
func SetClientWriteDropPercent(p int)
SetClientWriteDropPercent sets the write drop percent for clients.
func SetMsgLengtheningPercent ¶
func SetMsgLengtheningPercent(p int)
SetMsgLengtheningPercent sets the message lengthening percentfor clients and servers.
func SetMsgShorteningPercent ¶
func SetMsgShorteningPercent(p int)
SetMsgShorteningPercent sets the message shortening percent for clients and servers.
func SetReadDropPercent ¶
func SetReadDropPercent(p int)
SetReadDropPercent sets the read drop percent for both clients and servers.
func SetServerReadDropPercent ¶
func SetServerReadDropPercent(p int)
SetServerReadDropPercent sets the read drop percent for servers.
func SetServerWriteDropPercent ¶
func SetServerWriteDropPercent(p int)
SetServerWriteDropPercent sets the write drop percent for servers.
func SetWriteDropPercent ¶
func SetWriteDropPercent(p int)
SetWriteDropPercent sets the write drop percent for clients and servers.
func SplitHostPort ¶
SplitHostPort behaves the same as the net.SplitHostPort function.
Types ¶
type TemporaryMessage ¶
This really shouldn't be here as it is a break of abstraction, but it is a minor hack to vary the payload length.
type UDPAddr ¶
type UDPAddr struct {
// contains filtered or unexported fields
}
UDPAddr is a wrapper around net.UDPAddr.
func ResolveUDPAddr ¶
ResolveUDPAddr behaves the same as the net.UDPAddr.ResolveUDPAddr method (with some additional book-keeping).
type UDPConn ¶
type UDPConn struct {
// contains filtered or unexported fields
}
UDPConn is a wrapper around net.UDPConn. Method invocations are for the most part proxied directly to the corresponding methods in the net.UDPConn packge, but provide some additional book-keeping that is necessary for testing the students' code.
func DialUDP ¶
DialUDP behaves the same as the net.DialUDP method (with some additional book-keeping).
Clients should use this method to connect to the server.
func ListenUDP ¶
ListenUDP behaves the same as the net.ListenUDP method (with some additional book-keeping).
Servers should use this method to begin listening for incoming client connections.
func (*UDPConn) ReadFromUDP ¶
ReadFromUDP reads a UDP packet from c, copying the payload into b. It returns the number of bytes copied into b and the return address that was on the packet.