@@ -3,11 +3,12 @@ package gosocketio
33import (
44 "encoding/json"
55 "errors"
6- "github.com/graarh/golang-socketio/protocol"
7- "github.com/graarh/golang-socketio/transport"
86 "net/http"
97 "sync"
108 "time"
9+
10+ "github.com/JulianKropp/golang-socketio/protocol"
11+ "github.com/JulianKropp/golang-socketio/transport"
1112)
1213
1314const (
1819 ErrorWrongHeader = errors .New ("Wrong header" )
1920)
2021
21- /**
22+ /*
23+ *
2224engine.io header to send or receive
2325*/
2426type Header struct {
@@ -28,7 +30,8 @@ type Header struct {
2830 PingTimeout int `json:"pingTimeout"`
2931}
3032
31- /**
33+ /*
34+ *
3235socket.io connection handler
3336
3437use IsAlive to check that handler is still working
@@ -53,7 +56,8 @@ type Channel struct {
5356 requestHeader http.Header
5457}
5558
56- /**
59+ /*
60+ *
5761create channel, map, and set active
5862*/
5963func (c * Channel ) initChannel () {
@@ -63,14 +67,16 @@ func (c *Channel) initChannel() {
6367 c .alive = true
6468}
6569
66- /**
70+ /*
71+ *
6772Get id of current socket connection
6873*/
6974func (c * Channel ) Id () string {
7075 return c .header .Sid
7176}
7277
73- /**
78+ /*
79+ *
7480Checks that Channel is still alive
7581*/
7682func (c * Channel ) IsAlive () bool {
@@ -80,7 +86,8 @@ func (c *Channel) IsAlive() bool {
8086 return c .alive
8187}
8288
83- /**
89+ /*
90+ *
8491Close channel
8592*/
8693func closeChannel (c * Channel , m * methods , args ... interface {}) error {
@@ -110,7 +117,7 @@ func closeChannel(c *Channel, m *methods, args ...interface{}) error {
110117 return nil
111118}
112119
113- //incoming messages loop, puts incoming messages to In channel
120+ // incoming messages loop, puts incoming messages to In channel
114121func inLoop (c * Channel , m * methods ) error {
115122 for {
116123 pkg , err := c .conn .GetMessage ()
@@ -149,7 +156,8 @@ func AmountOfOverflooded() int64 {
149156 return int64 (len (overflooded ))
150157}
151158
152- /**
159+ /*
160+ *
153161outgoing messages loop, sends messages from channel to socket
154162*/
155163func outLoop (c * Channel , m * methods ) error {
@@ -180,7 +188,8 @@ func outLoop(c *Channel, m *methods) error {
180188 return nil
181189}
182190
183- /**
191+ /*
192+ *
184193Pinger sends ping messages for keeping connection alive
185194*/
186195func pinger (c * Channel ) {
0 commit comments