Skip to content

Commit

Permalink
add Conn.UserData and Conn.SessionID
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Apr 4, 2012
1 parent e5ac65b commit f4cb60d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type Conn struct {
dec Decoder
decBuf bytes.Buffer
raddr string

UserData interface{} // User data
}

// NewConn creates a new connection for the sio. It generates the session id and
Expand Down Expand Up @@ -75,6 +77,11 @@ func (c *Conn) String() string {
return fmt.Sprintf("%v[%v]", c.sessionid, c.socket)
}

// SessionID return the session id of Conn
func (c *Conn) SessionID() SessionID {
return c.sessionid
}

// RemoteAddr returns the remote network address of the connection in IP:port format
func (c *Conn) RemoteAddr() string {
return c.raddr
Expand Down

0 comments on commit f4cb60d

Please sign in to comment.