Skip to content

Commit

Permalink
Renaming the tcpconn file, updating the readme and bench files
Browse files Browse the repository at this point in the history
  • Loading branch information
StabbyCutyou committed Mar 24, 2016
1 parent 1768882 commit 22c8d55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions BENCH.md
Expand Up @@ -8,14 +8,14 @@ There are also some benchmark tests in the test suite, however by default they r
When running the test_server with a GOMAXPROCS of 8 listening on a single socket, and running 16 test_clients processes each writing to the servers socket as fast as they can with the same 110 byte protobuffs payload in a single go routine, I'm able to achieve the following throughput:

```
Average Messages per Second: 1129942.6507177034
Maximum Messages per Second 1277944
Minimum Messages per Second 1006401
Average Bytes per Second 124293691.57894738
Average MegaBytes per Second 118.53570135016192
Average Megabits per Second 948.2856108012953
Average Messages per Second: 1122358.274390244
Maximum Messages per Second 1342711
Minimum Messages per Second 939818
Average Bytes per Second 123459410.18292683
Average MegaBytes per Second 117.74006861012157
Average Megabits per Second 941.9205488809725
```

Visually, this looks like so

![sample benchmark](http://i.imgur.com/TWoqXYj.png "Sample Benchmark")
![sample benchmark](http://i.imgur.com/M3kEiu7.png "Sample Benchmark")
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -124,10 +124,10 @@ The callback is currently run in it's own goroutine, which also handles reading
Writing messages
================

To begin writing messages, you'll need to dial a TCPWriter using TCPWriterConfig
To begin writing messages to a new connection, you'll need to dial a using TCPConnConfig

```go
cfg := TCPWriterConfig {
cfg := TCPConnConfig {
EnableLogging: false, // true will have log messages printed to stdout/stderr, via log
MaxMessageSize: 4098, // You want this to match the MaxMessageSize the server expects for messages on that socket
Address: FormatAddress("127.0.0.1", strconv.Itoa(5031)) // Any address with the pattern ip:port. The FormatAddress helper is here for convenience.
Expand All @@ -137,13 +137,15 @@ cfg := TCPWriterConfig {
Once you have a configuration object, you can Dial out.

```go
btw, err := buffstreams.DialTCP(cfg)
btc, err := buffstreams.DialTCP(cfg)
```

This will open a connection to the endpoint at the specified location. From there, you can write your data
This will open a connection to the endpoint at the specified location. Additionally, the TCPConn that the TCPListener returns will also allow you to write data, using the same methods as below.

From there, you can write your data

```go
bytesWritten, err := btw.Write(msgBytes, true)
bytesWritten, err := btc.Write(msgBytes, true)
```

If there is an error in writing, that connection will be closed and be reopened on the next write. There is no guarantee if any the bytesWritten value will be >0 or not in the event of an error which results in a reconnect.
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 22c8d55

Please sign in to comment.