<commit_before>//
//  ViewController.swift
//  SwiftYampTester
//
//  Created by <NAME> on 6/15/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import Starscream
import SwiftYamp
import ByteBackpacker

class ViewController: UIViewController {
    var d:Data = Data()
    var socket:WebSocketConnection?

    @IBAction func onConnectButton(_ sender: Any) {
        //you could do onPong as well.
        socket?.connect()
    }
    
    @IBAction func onPingButton(_ sender: Any) {
        socket?.sendPing(payload: "hi")
    }
    
    @IBAction func onCloseButton(_ sender: Any) {
        socket?.cancel(reason: "close")
    }
    
    @IBAction func onSendRequestButton(_ sender: Any) {
        socket?.sendMessage(uri: "uri", message: "Test")
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        socket = WebSocketConnection(url: "ws://localhost:8888")!
        
        
        socket?.onConnect = {
            print("websocket is connected")
        }
        //websocketDidDisconnect
        socket?.onClose = { (reason: String?) in
            print("websocket is disconnected: \(String(describing: reason))")
        }
        //websocketDidReceiveMessage
        socket?.onResponse = { (response: ResponseFrame) in
            print("got some text: \(response)")
        }<commit_msg>checked with yyyar server<commit_after>//
//  ViewController.swift
//  SwiftYampTester
//
//  Created by <NAME> on 6/15/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import Starscream
import SwiftYamp
import ByteBackpacker

class ViewController: UIViewController {
    var d:Data = Data()
    var socket:WebSocketConnection?

    @IBAction func onConnectButton(_ sender: Any) {
        //you could do onPong as well.
        socket?.connect()
    }
    
    @IBAction func onPingButton(_ sender: Any) {
        socket?.sendPing(payload: "hi")
    }
    
    @IBAction func onCloseButton(_ sender: Any) {
        socket?.cancel(reason: "close")
    }
    
    @IBAction func onSendRequestButton(_ sender: Any) {
        socket?.sendMessage(uri: "mul", message: "22")
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        socket = WebSocketConnection(url: "ws://localhost:8888")!
        
        
        socket?.onConnect = {
            print("websocket is connected")
        }
        //websocketDidDisconnect
        socket?.onClose = { (reason: String?) in
            print("websocket is disconnected: \(String(describing: reason))")
        }
        //websocketDidReceiveMessage
        socket?.onResponse = { (response: ResponseFrame) in
            print("got some text: \(response)")
        }
{'fraction_non_alphanumeric': 0.1127348643006263, 'fraction_numerical': 0.009742519137091163, 'mean_word_length': 2.289473684210526, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3381207', 'n_tokens_mistral': 861, 'n_tokens_neox': 812, 'n_words': 219}