Updated WS API. Fixes #219. Closes #220

This commit is contained in:
obscuren
2015-01-06 11:44:22 +01:00
parent 47e6b2cef8
commit a26aecdfdb
4 changed files with 38 additions and 42 deletions

View File

@ -50,8 +50,8 @@ func (c *Client) Conn() *ws.Conn {
return c.ws
}
func (c *Client) Write(data interface{}, seed int) {
msg := &Message{Seed: seed, Data: data}
func (c *Client) Write(data interface{}, id int) {
msg := &Message{Id: id, Data: data}
select {
case c.ch <- msg:
default:
@ -73,7 +73,6 @@ func (c *Client) Listen() {
// Listen write request via chanel
func (c *Client) listenWrite() {
wslogger.Debugln("Listening write to client")
for {
select {
@ -93,7 +92,6 @@ func (c *Client) listenWrite() {
// Listen read request via chanel
func (c *Client) listenRead() {
wslogger.Debugln("Listening read from client")
for {
select {