             if options.onChannelError?
                 do options.onChannelError
 
+    # Check if datachannels are available and create one.
     createDataChannel       = () =>
         try
             if peerConnection.createDataChannel?

                return
            , constraints

    peerConnection.peerCreateAnswer = (offer) =>
        if offer?
            peerConnection.setRemoteDescription new SessionDescription(offer)

    if options.stream
        peerConnection.addStream options.stream

    # Create peerConnection offers and send them to a guest.
    peerConnection.peerCreateOffer = (onoffer) =>
        if onoffer?
            peerConnection.createOffer (sessionDescription) =>
