Compare commits
6 Commits
nmdc-log-s
...
nmdc-log-s
| Author | SHA1 | Date | |
|---|---|---|---|
| 32f64690c9 | |||
| 3f66cd93c7 | |||
| 9b32682c8a | |||
| c9e95df0df | |||
| a2b94e8724 | |||
| 3dfef302ee |
2
.hgtags
2
.hgtags
@@ -4,3 +4,5 @@
|
|||||||
d8b64d5527c2a5e4d76872e5bc3d69f7646135c6 libnmdc-r3
|
d8b64d5527c2a5e4d76872e5bc3d69f7646135c6 libnmdc-r3
|
||||||
fca41372e400853775b02e951f9db91d87f41adb nmdc-log-service-1.0.1
|
fca41372e400853775b02e951f9db91d87f41adb nmdc-log-service-1.0.1
|
||||||
050b424a7c5d5a27c9323c8810f3afbead1f5b96 libnmdc-r4
|
050b424a7c5d5a27c9323c8810f3afbead1f5b96 libnmdc-r4
|
||||||
|
da9f123633f9c28be6435ed7898139665d4c39d9 nmdc-log-service-1.0.2
|
||||||
|
75a78f6a78f249a2cd8aa3d29f7e5e6319b4e03b libnmdc-r5
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ Tags: nmdc
|
|||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2016-04-04 r5
|
||||||
|
- Enhancement: Support protocol keepalives
|
||||||
|
- Enhancement: Support hub redirects (`$ForceMove`)
|
||||||
|
|
||||||
2016-04-03 r4
|
2016-04-03 r4
|
||||||
- Feature: Add synchronous API
|
- Feature: Add synchronous API
|
||||||
- Fix an issue with reading HubConnection's state parameter
|
- Fix an issue with reading HubConnection's state parameter
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
DEFAULT_CLIENT_TAG string = "libnmdc.go"
|
DEFAULT_CLIENT_TAG string = "libnmdc.go"
|
||||||
DEFAULT_HUB_NAME string = "(unknown)"
|
DEFAULT_HUB_NAME string = "(unknown)"
|
||||||
|
SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConnectionState int
|
type ConnectionState int
|
||||||
@@ -314,15 +315,13 @@ func (this *HubConnection) processProtocolMessage(message string) {
|
|||||||
this.State = CONNECTIONSTATE_CONNECTED
|
this.State = CONNECTIONSTATE_CONNECTED
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$UserCommand":
|
|
||||||
// $UserCommand 1 1 Group chat\New group chat$<%[mynick]> !groupchat_new||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
case "$ForceMove":
|
case "$ForceMove":
|
||||||
// TODO
|
this.Hco.Address = HubAddress(commandParts[1])
|
||||||
|
this.conn.Close() // we'll reconnect onto the new address
|
||||||
|
|
||||||
// IGNORABLE COMMANDS
|
// IGNORABLE COMMANDS
|
||||||
case "$Supports":
|
case "$Supports":
|
||||||
|
case "$UserCommand": // TODO $UserCommand 1 1 Group chat\New group chat$<%[mynick]> !groupchat_new||
|
||||||
case "$UserList":
|
case "$UserList":
|
||||||
case "$OpList":
|
case "$OpList":
|
||||||
case "$HubTopic":
|
case "$HubTopic":
|
||||||
@@ -370,7 +369,17 @@ func (this *HubConnection) worker() {
|
|||||||
// Read from socket into our local buffer (blocking)
|
// Read from socket into our local buffer (blocking)
|
||||||
if this.connValid {
|
if this.connValid {
|
||||||
readBuff := make([]byte, 1024)
|
readBuff := make([]byte, 1024)
|
||||||
|
this.conn.SetReadDeadline(time.Now().Add(SEND_KEEPALIVE_EVERY))
|
||||||
nbytes, err = this.conn.Read(readBuff)
|
nbytes, err = this.conn.Read(readBuff)
|
||||||
|
|
||||||
|
if err != nil && err.(net.Error).Timeout() {
|
||||||
|
// No data before read deadline
|
||||||
|
err = nil
|
||||||
|
|
||||||
|
// Send KA packet
|
||||||
|
_, err = this.conn.Write([]byte("|"))
|
||||||
|
}
|
||||||
|
|
||||||
if nbytes > 0 {
|
if nbytes > 0 {
|
||||||
fullBuffer += string(readBuff[0:nbytes])
|
fullBuffer += string(readBuff[0:nbytes])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ Usage of nmdc-log-service:
|
|||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2016-04-04 1.0.3
|
||||||
|
- Enhancement: Upgrade `libnmdc` from `r4` to `r5`
|
||||||
|
|
||||||
2016-04-03 1.0.2
|
2016-04-03 1.0.2
|
||||||
- Enhancement: Upgrade `libnmdc` from `r3` to `r4`
|
- Enhancement: Upgrade `libnmdc` from `r3` to `r4`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user