Repository: qpid-proton
Updated Branches:
  refs/heads/master 43eb7f05f -> f7a4cb3ea


NO-JIRA: Add gcc to appveyor config so cgo will work.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f7a4cb3e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f7a4cb3e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f7a4cb3e

Branch: refs/heads/master
Commit: f7a4cb3ea11d6da3a9008b89350f5f4707f4975b
Parents: 63cd40f
Author: Alan Conway <[email protected]>
Authored: Mon Oct 12 16:54:20 2015 -0400
Committer: Alan Conway <[email protected]>
Committed: Tue Oct 13 10:59:42 2015 -0400

----------------------------------------------------------------------
 appveyor.yml                   |  1 +
 examples/go/electron/broker.go | 31 ++++++++++++++++++-------------
 2 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f7a4cb3e/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index a147e0d..9729c57 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,6 +2,7 @@ version: 0.10-SNAPSHOT-{branch}.{build}
 configuration: RelWithDebInfo
 install:
 - cinst -y swig
+- cinst -y mingw
 before_build:
 - mkdir BLD
 - cd BLD

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f7a4cb3e/examples/go/electron/broker.go
----------------------------------------------------------------------
diff --git a/examples/go/electron/broker.go b/examples/go/electron/broker.go
index 0ecfb92..1e4a931 100644
--- a/examples/go/electron/broker.go
+++ b/examples/go/electron/broker.go
@@ -30,6 +30,7 @@ import (
        "./util"
        "flag"
        "fmt"
+       "log"
        "net"
        "os"
        "qpid.apache.org/electron"
@@ -51,14 +52,27 @@ var qsize = flag.Int("qsize", 1000, "Max queue size")
 func main() {
        flag.Usage = usage
        flag.Parse()
+       if err := newBroker().run(); err != nil {
+               log.Fatal(err)
+       }
+}
+
+type broker struct {
+       queues    util.Queues
+       container electron.Container
+}
+
+func newBroker() *broker {
+       return &broker{util.MakeQueues(*qsize), electron.NewContainer("")}
+}
 
-       b := newBroker()
+func (b *broker) run() (err error) {
        listener, err := net.Listen("tcp", *addr)
-       util.ExitIf(err)
+       if err != nil {
+               return err
+       }
        defer listener.Close()
        fmt.Printf("Listening on %s\n", listener.Addr())
-
-       // Loop accepting new connections.
        for {
                conn, err := listener.Accept()
                if err != nil {
@@ -74,15 +88,6 @@ func main() {
        }
 }
 
-type broker struct {
-       queues    util.Queues
-       container electron.Container
-}
-
-func newBroker() *broker {
-       return &broker{util.MakeQueues(*qsize), electron.NewContainer("")}
-}
-
 // connection creates a new AMQP connection for a net.Conn.
 func (b *broker) connection(conn net.Conn) error {
        c, err := b.container.Connection(conn)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to