Added Created at to connection.

This commit is contained in:
claudemiro
2015-02-02 14:12:11 -03:00
parent 03607062aa
commit 7b578c4fb4
+4 -1
View File
@@ -5,6 +5,8 @@
package ipe
import (
"time"
log "github.com/golang/glog"
"github.com/gorilla/websocket"
)
@@ -13,13 +15,14 @@ import (
type connection struct {
SocketID string
Socket *websocket.Conn
CreatedAt time.Time
}
// Create a new Subscriber
func newConnection(socketID string, s *websocket.Conn) *connection {
log.Infof("Creating a new Subscriber %+v", socketID)
return &connection{SocketID: socketID, Socket: s}
return &connection{SocketID: socketID, Socket: s, CreatedAt: time.Now()}
}
// Publish the message to websocket atached to this client