         case PolicyViolated         = 1008
         case MessageTooBig          = 1009
     }
+
+    //Where the callback is executed. It defaults to the main UI thread queue.
+    var queue                   = dispatch_get_main_queue()
     var optionalProtocols       : Array<String>?
     //Constant Values.
     let headerWSUpgradeName     = "Upgrade"

            if !connected {
                connected = processHTTP(buffer, bufferLen: length)
                if !connected {
                    dispatch_async(dispatch_get_main_queue(),{
                        //self.workaroundMethod()
                        let error = self.errorWithDetail("Invalid HTTP upgrade", code: 1)
                        if let disconnect = self.disconnectedBlock {

        }
        if totalSize > 0 {
            if validateResponse(buffer, bufferLen: totalSize) {
                dispatch_async(queue,{
                    //self.workaroundMethod()
                    if let connectBlock = self.connectedBlock {
                        connectBlock()
