Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
logstash-forwarder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LaaS
logstash-forwarder
Commits
e7b142c6
Commit
e7b142c6
authored
Jul 02, 2013
by
Jordan Sissel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- pick a server at random when connecting
parent
08515b5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
publisher1.go
publisher1.go
+5
-1
No files found.
publisher1.go
View file @
e7b142c6
package
main
import
(
"math/rand"
"bytes"
"encoding/binary"
"encoding/pem"
...
...
@@ -133,8 +134,11 @@ func connect(config *NetworkConfig) (socket *tls.Conn) {
tlsconfig
.
RootCAs
.
AddCert
(
cert
)
}
address
:=
"127.0.0.1:3333"
for
{
// Pick a random server from the list.
address
:=
config
.
Servers
[
rand
.
Int
()
%
len
(
config
.
Servers
)]
log
.
Printf
(
"Connecting to %s
\n
"
,
address
)
tcpsocket
,
err
:=
net
.
DialTimeout
(
"tcp"
,
address
,
config
.
Timeout
)
if
err
!=
nil
{
log
.
Printf
(
"Failure connecting to %s: %s
\n
"
,
address
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment