Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break with Gt new message: <nil> #7

Open
aztrock opened this issue Aug 31, 2016 · 0 comments
Open

break with Gt new message: <nil> #7

aztrock opened this issue Aug 31, 2016 · 0 comments

Comments

@aztrock
Copy link

aztrock commented Aug 31, 2016

package main

import (
    "flag"
    "fmt"
    . "github.com/0x19/goesl"
    "runtime"
    //"strings"
)

var (
    fshost   = flag.String("fshost", "localhost", "Freeswitch hostname. Default: localhost")
    fsport   = flag.Uint("fsport", 8021, "Freeswitch port. Default: 8021")
    password = flag.String("pass", "ClueCon", "Freeswitch password. Default: ClueCon")
    timeout  = flag.Int("timeout", 10, "Freeswitch conneciton timeout in seconds. Default: 10")
)

func main() {
    runtime.GOMAXPROCS(runtime.NumCPU())
    client, err := NewClient(*fshost, *fsport, *password, *timeout)
    if err != nil {
        Error("Error while creating new client: %s", err)
        return
    }
    go client.Handle()
    client.Send("events json ALL")
    for {
        msg, _ := client.ReadMessage()
        fmt.Printf("Gt new message: %+v\n", msg)
    }
}

break the flow and not received more messages

08:19:18.278 Debug ▶ DEBUG Waiting for connection message to be received ...
Gt new message:
08:19:18.278 Debug ▶ DEBUG Waiting for connection message to be received ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant