Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



The channel package

import "appengine/channel"

Introduction

Package channel implements the server side of App Engine's Channel API.

Create creates a new channel associated with the given clientID, which must be unique to the client that will use the returned token.

token, err := channel.Create(c, "player1")
if err != nil {
    // handle error
}
// return token to the client in an HTTP response

Send sends a message to the client over the channel identified by clientID.

channel.Send(c, "player1", "Game over!")

Index

func Create(c appengine.Context, clientID string) (token string, err error)
func Send(c appengine.Context, clientID, message string) error
func SendJSON(c appengine.Context, clientID string, value interface{}) error

func Create

func Create(c appengine.Context, clientID string) (token string, err error)

Create creates a channel and returns a token for use by the client. The clientID is an application-provided string used to identify the client.

func Send

func Send(c appengine.Context, clientID, message string) error

Send sends a message on the channel associated with clientID.

func SendJSON

func SendJSON(c appengine.Context, clientID string, value interface{}) error

SendJSON is a helper function that sends a JSON-encoded value on the channel associated with clientID.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.