Compare commits
9 Commits
v0.4.0
...
nmdc-log-s
| Author | SHA1 | Date | |
|---|---|---|---|
| 32f64690c9 | |||
| 3f66cd93c7 | |||
| 9b32682c8a | |||
| c9e95df0df | |||
| a2b94e8724 | |||
| 3dfef302ee | |||
| 611a934a4e | |||
| 1a3617b960 | |||
| a37b1773d0 |
3
.hgtags
3
.hgtags
@@ -3,3 +3,6 @@
|
||||
137c1b65039e03c80379826a6efdfd808f6fbc8f libnmdc-r2
|
||||
d8b64d5527c2a5e4d76872e5bc3d69f7646135c6 libnmdc-r3
|
||||
fca41372e400853775b02e951f9db91d87f41adb nmdc-log-service-1.0.1
|
||||
050b424a7c5d5a27c9323c8810f3afbead1f5b96 libnmdc-r4
|
||||
da9f123633f9c28be6435ed7898139665d4c39d9 nmdc-log-service-1.0.2
|
||||
75a78f6a78f249a2cd8aa3d29f7e5e6319b4e03b libnmdc-r5
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
An NMDC client protocol library for Golang.
|
||||
|
||||
- Channel-based API.
|
||||
- Includes a sample logging client.
|
||||
- Offers both channel-based and synchronous APIs.
|
||||
- Includes a sample logging client using the channel-based API.
|
||||
- This code hosting site isn't (yet) compatible with `go get`.
|
||||
|
||||
Written in golang
|
||||
@@ -9,6 +9,15 @@ Tags: nmdc
|
||||
|
||||
=CHANGELOG=
|
||||
|
||||
2016-04-04 r5
|
||||
- Enhancement: Support protocol keepalives
|
||||
- Enhancement: Support hub redirects (`$ForceMove`)
|
||||
|
||||
2016-04-03 r4
|
||||
- Feature: Add synchronous API
|
||||
- Fix an issue with reading HubConnection's state parameter
|
||||
- Fix an issue with buffered protocol commands
|
||||
|
||||
2016-04-03 r3
|
||||
- Feature: Add `SkipVerifyTLS` option
|
||||
- Fix an issue with calling `panic()` if connection failed
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
const (
|
||||
DEFAULT_CLIENT_TAG string = "libnmdc.go"
|
||||
DEFAULT_HUB_NAME string = "(unknown)"
|
||||
SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second
|
||||
)
|
||||
|
||||
type ConnectionState int
|
||||
@@ -314,15 +315,13 @@ func (this *HubConnection) processProtocolMessage(message string) {
|
||||
this.State = CONNECTIONSTATE_CONNECTED
|
||||
}
|
||||
|
||||
case "$UserCommand":
|
||||
// $UserCommand 1 1 Group chat\New group chat$<%[mynick]> !groupchat_new||
|
||||
// TODO
|
||||
|
||||
case "$ForceMove":
|
||||
// TODO
|
||||
this.Hco.Address = HubAddress(commandParts[1])
|
||||
this.conn.Close() // we'll reconnect onto the new address
|
||||
|
||||
// IGNORABLE COMMANDS
|
||||
case "$Supports":
|
||||
case "$UserCommand": // TODO $UserCommand 1 1 Group chat\New group chat$<%[mynick]> !groupchat_new||
|
||||
case "$UserList":
|
||||
case "$OpList":
|
||||
case "$HubTopic":
|
||||
@@ -370,7 +369,17 @@ func (this *HubConnection) worker() {
|
||||
// Read from socket into our local buffer (blocking)
|
||||
if this.connValid {
|
||||
readBuff := make([]byte, 1024)
|
||||
this.conn.SetReadDeadline(time.Now().Add(SEND_KEEPALIVE_EVERY))
|
||||
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 {
|
||||
fullBuffer += string(readBuff[0:nbytes])
|
||||
}
|
||||
|
||||
@@ -30,6 +30,12 @@ Usage of nmdc-log-service:
|
||||
|
||||
=CHANGELOG=
|
||||
|
||||
2016-04-04 1.0.3
|
||||
- Enhancement: Upgrade `libnmdc` from `r4` to `r5`
|
||||
|
||||
2016-04-03 1.0.2
|
||||
- Enhancement: Upgrade `libnmdc` from `r3` to `r4`
|
||||
|
||||
2016-04-03 1.0.1
|
||||
- Enhancement: Add `-VerifyTLS` option
|
||||
- Enhancement: Upgrade `libnmdc` from `r2` to `r3`
|
||||
|
||||
Reference in New Issue
Block a user