Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cmu440/p1
/ functions
Functions
159 in github.com/cmu440/p1
⨍
Functions
159
◇
Types & classes
18
↓ 18 callers
Function
makeParams
(epochLimit, epochMillis, windowSize int)
src/github.com/cmu440/lsp/lsp1_test.go:193
↓ 18 callers
Function
newTestSystem
(t *testing.T, numClients int, params *Params)
src/github.com/cmu440/lsp/lsp1_test.go:58
↓ 18 callers
Method
runTest
(timeout int)
src/github.com/cmu440/lsp/lsp1_test.go:162
↓ 18 callers
Method
setDescription
(desc string)
src/github.com/cmu440/lsp/lsp1_test.go:48
↓ 18 callers
Method
setNumMsgs
(n int)
src/github.com/cmu440/lsp/lsp1_test.go:43
↓ 12 callers
Function
newSyncTestSystem
(t *testing.T, numClients, numMsgs int, mode syncTestMode, params *Params)
src/github.com/cmu440/lsp/lsp4_test.go:56
↓ 12 callers
Method
runTest
()
src/github.com/cmu440/lsp/lsp4_test.go:96
↓ 12 callers
Method
setDescription
(desc string)
src/github.com/cmu440/lsp/lsp4_test.go:86
↓ 12 callers
Method
setMaxEpochs
(maxEpochs int)
src/github.com/cmu440/lsp/lsp4_test.go:91
↓ 11 callers
Method
Read
Read reads a data message from a client and returns its payload, and the connection ID associated with the client that sent the message. This method s
src/github.com/cmu440/lsp/server_api.go:17
↓ 11 callers
Method
Write
Write sends a data message to the client with the specified connection ID. This method should NOT block, and should return a non-nil error if the conn
src/github.com/cmu440/lsp/server_api.go:22
↓ 10 callers
Method
Close
Close terminates all currently connected clients and shuts down the LSP server. This method should block until all pending messages for each client ar
src/github.com/cmu440/lsp/server_api.go:38
↓ 8 callers
Method
ConnID
ConnID returns the connection ID associated with this client.
src/github.com/cmu440/lsp/client_api.go:8
↓ 8 callers
Function
newCloseTestSystem
(t *testing.T, mode closeTestMode)
src/github.com/cmu440/lsp/lsp3_test.go:56
↓ 8 callers
Method
runTest
()
src/github.com/cmu440/lsp/lsp3_test.go:94
↓ 8 callers
Method
setDescription
(t string)
src/github.com/cmu440/lsp/lsp3_test.go:75
↓ 8 callers
Method
setMaxEpochs
(maxEpochs int)
src/github.com/cmu440/lsp/lsp3_test.go:80
↓ 8 callers
Method
setNumClients
(numClients int)
src/github.com/cmu440/lsp/lsp3_test.go:69
↓ 8 callers
Method
setParams
(epochLimit, epochMillis, windowSize int)
src/github.com/cmu440/lsp/lsp3_test.go:85
↓ 7 callers
Method
waitForClients
()
src/github.com/cmu440/lsp/lsp2_test.go:258
↓ 7 callers
Method
waitForServer
()
src/github.com/cmu440/lsp/lsp2_test.go:243
↓ 6 callers
Function
newWindowTestSystem
(t *testing.T, mode windowTestMode, numClients, numMsgs int, params *Params)
src/github.com/cmu440/lsp/lsp2_test.go:53
↓ 6 callers
Method
runTest
()
src/github.com/cmu440/lsp/lsp2_test.go:317
↓ 6 callers
Method
setDescription
(desc string)
src/github.com/cmu440/lsp/lsp2_test.go:118
↓ 6 callers
Method
setDropPercent
(p int)
src/github.com/cmu440/lsp/lsp1_test.go:53
↓ 6 callers
Method
setMaxEpochs
(maxEpochs int)
src/github.com/cmu440/lsp/lsp2_test.go:123
↓ 5 callers
Method
toggleNetwork
Toggle the network and wait until sends back a notification that it is done. Called from the master's goroutine.
src/github.com/cmu440/lsp/lsp4_test.go:365
↓ 5 callers
Method
waitForClients
Wait until we receive a notification from all clients (or timeout). Called from the master's goroutine.
src/github.com/cmu440/lsp/lsp4_test.go:346
↓ 5 callers
Method
waitForServer
Wait until we receive a notification from the server (or timeout). Called from the master's goroutine.
src/github.com/cmu440/lsp/lsp4_test.go:329
↓ 4 callers
Function
NewClient
NewClient creates, initiates, and returns a new client. This function should return after a connection with the server has been established (i.e., the
src/github.com/cmu440/lsp/client_impl.go:21
↓ 4 callers
Function
NewServer
NewServer creates, initiates, and returns a new server. This function should NOT block. Instead, it should spawn one or more goroutines (to handle thi
src/github.com/cmu440/lsp/server_impl.go:17
↓ 4 callers
Method
setClientWriteDropPercent
(percent int)
src/github.com/cmu440/lsp/lsp2_test.go:105
↓ 4 callers
Method
setMaxSleepMillis
(ms int)
src/github.com/cmu440/lsp/lsp1_test.go:38
↓ 4 callers
Method
setServerWriteDropPercent
(percent int)
src/github.com/cmu440/lsp/lsp2_test.go:100
↓ 4 callers
Method
signalClients
Send signal to all clients. Called from the master's goroutine.
src/github.com/cmu440/lsp/lsp4_test.go:320
↓ 4 callers
Method
signalServer
Send signal to server. Called from the master's goroutine.
src/github.com/cmu440/lsp/lsp4_test.go:314
↓ 4 callers
Method
toNet
()
src/github.com/cmu440/lspnet/addr.go:12
↓ 3 callers
Method
checkClientReadMsgs
(sentMsgs []string)
src/github.com/cmu440/lsp/lsp2_test.go:296
↓ 3 callers
Method
checkServerReadMsgs
(sentMsgs []string)
src/github.com/cmu440/lsp/lsp2_test.go:275
↓ 3 callers
Function
dropIt
(dropPercent int)
src/github.com/cmu440/lspnet/conn.go:115
↓ 3 callers
Function
isLoggingEnabled
()
src/github.com/cmu440/lspnet/conn.go:22
↓ 3 callers
Method
streamToClient
Server sends a stream of messages to a client.
src/github.com/cmu440/lsp/lsp2_test.go:150
↓ 3 callers
Method
streamToServer
Client sends a stream of messages to the server.
src/github.com/cmu440/lsp/lsp2_test.go:130
↓ 2 callers
Method
CloseConn
CloseConn terminates the client with the specified connection ID, returning a non-nil error if the specified connection ID does not exist. All pending
src/github.com/cmu440/lsp/server_api.go:28
↓ 2 callers
Method
makeRandMsgs
(numMsgs int)
src/github.com/cmu440/lsp/lsp2_test.go:110
↓ 2 callers
Function
readDropPercent
(c *UDPConn)
src/github.com/cmu440/lspnet/staff.go:60
↓ 2 callers
Method
readFromAllClients
Server reads a stream of messages from all currently connected clients.
src/github.com/cmu440/lsp/lsp2_test.go:208
↓ 2 callers
Method
readFromServer
Client reads a stream of messages from the server.
src/github.com/cmu440/lsp/lsp2_test.go:170
↓ 2 callers
Method
write
(b []byte, addr *UDPAddr)
src/github.com/cmu440/lspnet/conn.go:86
↓ 1 callers
Method
Close
Close terminates the client's connection with the server. It should block until all pending messages to the server have been sent and acknowledged. On
src/github.com/cmu440/lsp/client_api.go:29
↓ 1 callers
Method
Read
Read reads a data message from the server and returns its payload. This method should block until data has been received from the server and is ready
src/github.com/cmu440/lsp/client_api.go:16
↓ 1 callers
Function
SetClientReadDropPercent
SetClientReadDropPercent sets the read drop percent for clients.
src/github.com/cmu440/lspnet/staff.go:27
↓ 1 callers
Function
SetClientWriteDropPercent
SetClientWriteDropPercent sets the write drop percent for clients.
src/github.com/cmu440/lspnet/staff.go:34
↓ 1 callers
Function
SetReadDropPercent
SetReadDropPercent sets the read drop percent for both clients and servers.
src/github.com/cmu440/lspnet/staff.go:15
↓ 1 callers
Function
SetServerReadDropPercent
SetServerReadDropPercent sets the read drop percent for servers.
src/github.com/cmu440/lspnet/staff.go:41
↓ 1 callers
Function
SetServerWriteDropPercent
SetServerWriteDropPercent sets the write drop percent for servers.
src/github.com/cmu440/lspnet/staff.go:48
↓ 1 callers
Function
SetWriteDropPercent
SetWriteDropPercent sets the write drop percent for clients and servers.
src/github.com/cmu440/lspnet/staff.go:21
↓ 1 callers
Method
String
String returns a string representation of this params. To pretty-print a params, you can pass it to a format string like so: params := NewParams() fmt
src/github.com/cmu440/lsp/params.go:41
↓ 1 callers
Method
Write
Write sends a data message with the specified payload to the server. This method should NOT block, and should return a non-nil error if the connection
src/github.com/cmu440/lsp/client_api.go:21
↓ 1 callers
Method
WriteToUDP
WriteToUDP writes a UDP packet to addr via c, copying the payload from b.
src/github.com/cmu440/lspnet/conn.go:79
↓ 1 callers
Method
buildClient
Create client. Have it generate messages and check that they are echoed.
src/github.com/cmu440/lsp/lsp3_test.go:253
↓ 1 callers
Method
buildServer
()
src/github.com/cmu440/lsp/lsp3_test.go:175
↓ 1 callers
Method
createClient
(index int)
src/github.com/cmu440/lsp/lsp3_test.go:169
↓ 1 callers
Method
createServer
()
src/github.com/cmu440/lsp/lsp3_test.go:163
↓ 1 callers
Method
master
Master method to coordinate the test.
src/github.com/cmu440/lsp/lsp4_test.go:380
↓ 1 callers
Method
randSleep
()
src/github.com/cmu440/lsp/lsp1_test.go:115
↓ 1 callers
Function
runClient
(cli lsp.Client)
src/github.com/cmu440/crunner/crunner.go:56
↓ 1 callers
Method
runClient
Runs a simple echo server and tests whether messages are correctly sent and received. Some tests introduce up to 20% packet loss, random delays, multi
src/github.com/cmu440/lsp/lsp1_test.go:124
↓ 1 callers
Method
runClient
Create and runs a client. Runs in a background goroutine. Called once per client at the very beginning of a test.
src/github.com/cmu440/lsp/lsp4_test.go:241
↓ 1 callers
Method
runMaxCapacityTest
()
src/github.com/cmu440/lsp/lsp2_test.go:330
↓ 1 callers
Method
runNetwork
Alternates between turning network writes on and off in a loop. Runs in a background goroutine and is started once at the very beginning of a test.
src/github.com/cmu440/lsp/lsp4_test.go:113
↓ 1 callers
Method
runScatteredMsgsTest
()
src/github.com/cmu440/lsp/lsp2_test.go:397
↓ 1 callers
Function
runServer
(srv lsp.Server)
src/github.com/cmu440/srunner/srunner.go:54
↓ 1 callers
Method
runServer
runServer sets up the server and reads/echos messages back to clients.
src/github.com/cmu440/lsp/lsp1_test.go:95
↓ 1 callers
Method
runServer
Create and runs the server. Runs in a background goroutine and is started once at the very beginning of a test.
src/github.com/cmu440/lsp/lsp4_test.go:143
↓ 1 callers
Function
writeDropPercent
(c *UDPConn)
src/github.com/cmu440/lspnet/staff.go:72
Method
Close
()
src/github.com/cmu440/lsp/client_impl.go:39
Method
Close
()
src/github.com/cmu440/lsp/server_impl.go:35
Method
Close
Close closes the connection.
src/github.com/cmu440/lspnet/conn.go:105
Method
CloseConn
(connID int)
src/github.com/cmu440/lsp/server_impl.go:31
Method
ConnID
()
src/github.com/cmu440/lsp/client_impl.go:25
Function
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.
src/github.com/cmu440/lspnet/net.go:58
Function
EnableDebugLogs
EnableDebugLogs has log messages directed to standard output if enable is true.
src/github.com/cmu440/lspnet/conn.go:14
Function
Hash
Hash concatentates a message and a nonce and generates a hash value. Only miners should ever need to call this method.
src/github.com/cmu440/bitcoin/hash.go:11
Function
JoinHostPort
JoinHostPort behaves the same as the net.JoinHostPort function.
src/github.com/cmu440/lspnet/net.go:79
Function
ListenUDP
ListenUDP behaves the same as the net.ListenUDP method (with some additional book-keeping). Servers should use this method to begin listening for inc
src/github.com/cmu440/lspnet/net.go:37
Function
NewAck
NewAck returns a new acknowledgement message with the specified connection ID and sequence number.
src/github.com/cmu440/lsp/message.go:42
Function
NewConnect
NewConnect returns a new connect message.
src/github.com/cmu440/lsp/message.go:25
Function
NewData
NewData returns a new data message with the specified connection ID, sequence number, and payload.
src/github.com/cmu440/lsp/message.go:31
Function
NewJoin
NewJoin creates a join message. Miners send join messages to the server.
src/github.com/cmu440/bitcoin/message.go:45
Function
NewParams
NewParams returns a Params with default field values.
src/github.com/cmu440/lsp/params.go:29
Function
NewRequest
NewRequest creates a request message. Clients send request messages to the server and the server sends request messages to miners.
src/github.com/cmu440/bitcoin/message.go:25
Function
NewResult
New result creates a result message. Miners send result messages to the server and the server sends result messages to clients.
src/github.com/cmu440/bitcoin/message.go:36
Method
Read
()
src/github.com/cmu440/lsp/client_impl.go:29
Method
Read
()
src/github.com/cmu440/lsp/server_impl.go:21
Method
Read
Read implements the Conn Read method.
src/github.com/cmu440/lspnet/conn.go:34
Method
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
src/github.com/cmu440/lspnet/conn.go:53
Function
ResetDropPercent
ResetDropPercent resets all drop percents to 0.
src/github.com/cmu440/lspnet/staff.go:55
Function
ResolveUDPAddr
ResolveUDPAddr behaves the same as the net.UDPAddr.ResolveUDPAddr method (with some additional book-keeping).
src/github.com/cmu440/lspnet/net.go:24
Function
SplitHostPort
SplitHostPort behaves the same as the net.SplitHostPort function.
src/github.com/cmu440/lspnet/net.go:84
next →
1–100 of 159, ranked by callers