_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c164100
train
// NumClients will report the number of registered clients.
{ "resource": "" }
c164101
train
// getClient will return the client associated with cid.
{ "resource": "" }
c164102
train
// NumSubscriptions will report how many subscriptions are active.
{ "resource": "" }
c164103
train
// numSubscriptions will report how many subscriptions are active. // Lock should be held.
{ "resource": "" }
c164104
train
// ConfigTime will report the last time the server configuration was loaded.
{ "resource": "" }
c164105
train
// Addr will return the net.Addr object for the current listener.
{ "resource": "" }
c164106
train
// MonitorAddr will return the net.Addr object for the monitoring listener.
{ "resource": "" }
c164107
train
// ClusterAddr returns the net.Addr object for the route listener.
{ "resource": "" }
c164108
train
// ProfilerAddr returns the net.Addr object for the route listener.
{ "resource": "" }
c164109
train
// ReadyForConnections returns `true` if the server is ready to accept clients // and, if routing is enabled, route connections. If after the duration // `dur` the server is still not ready, returns `false`.
{ "resource": "" }
c164110
train
// ID returns the server's ID
{ "resource": "" }
c164111
train
// getClientConnectURLs returns suitable URLs for clients to connect to the listen // port based on the server options' Host and Port. If the Host corresponds to // "any" interfaces, this call returns the list of resolved IP addresses. // If ClientAdvertise is set, returns the client advertise host and port. // The ser...
{ "resource": "" }
c164112
train
// if the ip is not specified, attempt to resolve it
{ "resource": "" }
c164113
train
// format the address of a net.Listener with a protocol
{ "resource": "" }
c164114
train
// PortsInfo attempts to resolve all the ports. If after maxWait the ports are not // resolved, it returns nil. Otherwise it returns a Ports struct // describing ports where the server can be contacted
{ "resource": "" }
c164115
train
// Returns the portsFile. If a non-empty dirHint is provided, the dirHint // path is used instead of the server option value
{ "resource": "" }
c164116
train
// Delete the ports file. If a non-empty dirHint is provided, the dirHint // path is used instead of the server option value
{ "resource": "" }
c164117
train
// Writes a file with a serialized Ports to the specified ports_file_dir. // The name of the file is `exename_pid.ports`, typically gnatsd_pid.ports. // if ports file is not set, this function has no effect
{ "resource": "" }
c164118
train
// waits until a calculated list of listeners is resolved or a timeout
{ "resource": "" }
c164119
train
// returns a list of listeners that are intended for the process // if the entry is nil, the interface is yet to be resolved
{ "resource": "" }
c164120
train
// Returns true if in lame duck mode.
{ "resource": "" }
c164121
train
// This function will close the client listener then close the clients // at some interval to avoid a reconnecting storm.
{ "resource": "" }
c164122
train
// pdhGetFormattedCounterArrayDouble returns the value of return code // rather than error, to easily check return codes
{ "resource": "" }
c164123
train
// getProcessImageName returns the name of the process image, as expected by // the performance counter API.
{ "resource": "" }
c164124
train
// initialize our counters
{ "resource": "" }
c164125
train
// ProcUsage returns process CPU and memory statistics
{ "resource": "" }
c164126
train
// NonceRequired tells us if we should send a nonce.
{ "resource": "" }
c164127
train
// nonceRequired tells us if we should send a nonce. // Lock should be held on entry.
{ "resource": "" }
c164128
train
// Generate a nonce for INFO challenge. // Assumes server lock is held
{ "resource": "" }
c164129
train
// setIfNotSet will set the flag `c` only if that flag was not already // set and return true to indicate that the flag has been set. Returns // false otherwise.
{ "resource": "" }
c164130
train
// GetTLSConnectionState returns the TLS ConnectionState if TLS is enabled, nil // otherwise. Implements the ClientAuth interface.
{ "resource": "" }
c164131
train
// RemoteAddress expose the Address of the client connection, // nil when not connected or unknown
{ "resource": "" }
c164132
train
// Helper function to report errors.
{ "resource": "" }
c164133
train
// registerWithAccount will register the given user with a specific // account. This will change the subject namespace.
{ "resource": "" }
c164134
train
// Helper to determine if we have met or exceeded max subs.
{ "resource": "" }
c164135
train
// RegisterUser allows auth to call back into a new client // with the authenticated user. This is used to map // any permissions into the client and setup accounts.
{ "resource": "" }
c164136
train
// RegisterNkey allows auth to call back into a new nkey // client with the authenticated user. This is used to map // any permissions into the client and setup accounts.
{ "resource": "" }
c164137
train
// Initializes client.perms structure. // Lock is held on entry.
{ "resource": "" }
c164138
train
// This will load up the deny structure used for filtering delivered // messages based on a deny clause for subscriptions. // Lock should be held.
{ "resource": "" }
c164139
train
// writeLoop is the main socket write functionality. // Runs in its own Go routine.
{ "resource": "" }
c164140
train
// flushClients will make sure to flush any clients we may have // sent to during processing. We pass in a budget as a time.Duration // for how much time to spend in place flushing for this client. This // will normally be called in the readLoop of the client who sent the // message that now is being delivered.
{ "resource": "" }
c164141
train
// collapsePtoNB will place primary onto nb buffer as needed in prep for WriteTo. // This will return a copy on purpose.
{ "resource": "" }
c164142
train
// This will handle the fixup needed on a partial write. // Assume pending has been already calculated correctly.
{ "resource": "" }
c164143
train
// flushSignal will use server to queue the flush IO operation to a pool of flushers. // Lock must be held.
{ "resource": "" }
c164144
train
// Process the information messages from Clients and other Routes.
{ "resource": "" }
c164145
train
// removePassFromTrace removes any notion of passwords from trace // messages for logging.
{ "resource": "" }
c164146
train
// Generates the INFO to be sent to the client with the client ID included. // info arg will be copied since passed by value. // Assume lock is held.
{ "resource": "" }
c164147
train
// If the client's account has stream imports and there are matches for // this subscription's subject, then add shadow subscriptions in // other accounts that can export this subject.
{ "resource": "" }
c164148
train
// Add in the shadow subscription.
{ "resource": "" }
c164149
train
// canSubscribe determines if the client is authorized to subscribe to the // given subject. Assumes caller is holding lock.
{ "resource": "" }
c164150
train
// Low level unsubscribe for a given client.
{ "resource": "" }
c164151
train
// checkDenySub will check if we are allowed to deliver this message in the // presence of deny clauses for subscriptions. Deny clauses will not prevent // larger scoped wildcard subscriptions, so we need to check at delivery time. // Lock should be held.
{ "resource": "" }
c164152
train
// pruneDenyCache will prune the deny cache via randomly // deleting items. Doing so pruneSize items at a time. // Lock must be held for this one since it is shared under // deliverMsg.
{ "resource": "" }
c164153
train
// prunePubPermsCache will prune the cache via randomly // deleting items. Doing so pruneSize items at a time.
{ "resource": "" }
c164154
train
// pubAllowed checks on publish permissioning.
{ "resource": "" }
c164155
train
// newServiceReply is used when rewriting replies that cross account boundaries. // These will look like _R_.XXXXXXXX.
{ "resource": "" }
c164156
train
// This will decide to call the client code or router code.
{ "resource": "" }
c164157
train
// This checks and process import services by doing the mapping and sending the // message onward if applicable.
{ "resource": "" }
c164158
train
// We may reuse atmr for expiring user jwts, // so check connectReceived. // Lock assume held on entry.
{ "resource": "" }
c164159
train
// This will set the atmr for the JWT expiration time. // We will lock on entry.
{ "resource": "" }
c164160
train
// Returns the client's RTT value with the protection of the client's lock.
{ "resource": "" }
c164161
train
// Account will return the associated account for this client.
{ "resource": "" }
c164162
train
// prunePerAccountCache will prune off a random number of cache entries.
{ "resource": "" }
c164163
train
// getAuthUser returns the auth user for the client.
{ "resource": "" }
c164164
train
// ProcessSignal sends the given signal command to the running gnatsd service. // If service is empty, this signals the "gnatsd" service. This returns an // error is the given service is not running or the command is invalid.
{ "resource": "" }
c164165
train
// ProcUsage returns CPU usage
{ "resource": "" }
c164166
train
// clone returns a deep copy of the RemoteGatewayOpts object
{ "resource": "" }
c164167
train
// Ensure that gateway is properly configured.
{ "resource": "" }
c164168
train
// Computes a hash of 4 characters for the given gateway name. // This will be used for routing of replies.
{ "resource": "" }
c164169
train
// Initialize the s.gateway structure. We do this even if the server // does not have a gateway configured. In some part of the code, the // server will check the number of outbound gateways, etc.. and so // we don't have to check if s.gateway is nil or not.
{ "resource": "" }
c164170
train
// Returns the Gateway's name of this server.
{ "resource": "" }
c164171
train
// Returns the Gateway URLs of all servers in the local cluster. // This is used to send to other cluster this server connects to. // The gateway read-lock is held on entry
{ "resource": "" }
c164172
train
// Returns if this server rejects connections from gateways that are not // explicitly configured.
{ "resource": "" }
c164173
train
// Similar to setInfoHostPortAndGenerateJSON, but for gatewayInfo.
{ "resource": "" }
c164174
train
// Generates the Gateway INFO protocol. // The gateway lock is held on entry
{ "resource": "" }
c164175
train
// Reconnect to the gateway after a little wait period. For explicit // gateways, we also wait for the default reconnect time.
{ "resource": "" }
c164176
train
// This function will loop trying to connect to any URL attached // to the given Gateway. It will return once a connection has been created.
{ "resource": "" }
c164177
train
// Builds and sends the CONNET protocol for a gateway.
{ "resource": "" }
c164178
train
// Sends to the given inbound gateway connection a gossip INFO protocol // for each gateway known by this server. This allows for a "full mesh" // of gateways.
{ "resource": "" }
c164179
train
// Sends the INFO protocol of a gateway to all routes known by this server.
{ "resource": "" }
c164180
train
// Sends all subscriptions for the given account to the remove gateway // This is sent from the inbound side, that is, the side that receives // messages from the remote's outbound connection. This side is // the one sending the subscription interest.
{ "resource": "" }
c164181
train
// Sends INFO protocols to the given route connection for each known Gateway. // These will be processed by the route and delegated to the gateway code to // imvoke processImplicitGateway.
{ "resource": "" }
c164182
train
// Returns the number of outbound gateway connections
{ "resource": "" }
c164183
train
// Returns the number of inbound gateway connections
{ "resource": "" }
c164184
train
// Used in tests
{ "resource": "" }
c164185
train
// Returns if this remote gateway is implicit or not.
{ "resource": "" }
c164186
train
// getURLs returns an array of URLs in random order suitable for // an iteration to try to connect.
{ "resource": "" }
c164187
train
// Similar to getURLs but returns the urls as an array of strings.
{ "resource": "" }
c164188
train
// updateURLs creates the urls map with the content of the config's URLs array // and the given array that we get from the INFO protocol.
{ "resource": "" }
c164189
train
// add URLs from the given array to the urls map only if not already present. // remoteGateway write lock is assumed to be held on entry. // Write lock is held on entry.
{ "resource": "" }
c164190
train
// Adds this URL to the set of Gateway URLs // Server lock held on entry
{ "resource": "" }
c164191
train
// Remove this URL from the set of gateway URLs // Server lock held on entry
{ "resource": "" }
c164192
train
// This returns the URL of the Gateway listen spec, or empty string // if the server has no gateway configured.
{ "resource": "" }
c164193
train
// Returns all outbound gateway connections in the provided array. // The order of the gateways is suited for the sending of a message. // Current ordering is based on individual gateway's RTT value.
{ "resource": "" }
c164194
train
// Orders the array of outbound connections. // Current ordering is by lowest RTT. // Gateway write lock is held on entry
{ "resource": "" }
c164195
train
// Returns all inbound gateway connections in the provided array
{ "resource": "" }
c164196
train
// This is invoked when a gateway connection is closed and the server // is removing this connection from its state.
{ "resource": "" }
c164197
train
// GatewayAddr returns the net.Addr object for the gateway listener.
{ "resource": "" }
c164198
train
// switchAccountToInterestMode will switch an account over to interestMode. // Lock should NOT be held.
{ "resource": "" }
c164199
train
// Possibly sends an A- to the remote gateway `c`. // Invoked when processing an inbound message and the account is not found. // A check under a lock that protects processing of SUBs and UNSUBs is // done to make sure that we don't send the A- if a subscription has just // been created at the same time, which would ot...
{ "resource": "" }