compatibility updates for libnmdc
This commit is contained in:
parent
80d230be98
commit
aacebe5c5f
8
main.go
8
main.go
@ -50,12 +50,12 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
|
|
||||||
hco := libnmdc.HubConnectionOptions{
|
hco := libnmdc.HubConnectionOptions{
|
||||||
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
|
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
|
||||||
Self: *selfUser,
|
Self: selfUser,
|
||||||
NickPassword: Pass,
|
NickPassword: Pass,
|
||||||
NumEventsToBuffer: 0,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hub := hco.Connect()
|
hubEvents := make(chan libnmdc.HubEvent, 10)
|
||||||
|
hub := libnmdc.ConnectAsync(&hco, hubEvents)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
hub.Disconnect()
|
hub.Disconnect()
|
||||||
@ -105,7 +105,7 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
||||||
case hev, ok := <-hub.OnEvent:
|
case hev, ok := <-hubEvents:
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Printf("[%s] hub chan closed\n", so.Id())
|
log.Printf("[%s] hub chan closed\n", so.Id())
|
||||||
return // abandon
|
return // abandon
|
||||||
|
Loading…
Reference in New Issue
Block a user