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