- Create a channel object using the token returned by the
createChannel()call on the server.
Open a socket on this channel.
goog.appengine.Socketobject. You can set the callback properties directly on the returned socket object or set them using an optional object handler with the following properties:
If the token specified during channel creation is invalid or expired then the
onclosecallbacks will be called. The
codefield for the error object will be 401 (Unauthorized) and the
descriptionfield will be
onerrorcallback is also called asynchronously whenever the token for the channel expires. An
onerrorcall is always followed by an
onclosecall and the channel object will have to be recreated after this event.
- Close the socket. The socket cannot be used again after calling close; the server must create a new socket.
- Set this to a function called when the socket is ready to receive messages.
- Set this to a function called when the socket receives a message. The function is passed one parameter: a message object. The
datafield of this object is the string passed to the
send_messagemethod on the server.
- Set this property to a function called when an error occurs on the socket. The function is passed one parameter: an error object. The
descriptionfield is a description of the error and the
codefield is an HTTP error code indicating the error.
- Set this property to a function that called when the socket is closed. When the socket is closed, it cannot be reopened. Use the
open()method on a
goog.appengine.Channelobject to create a new socket.