@@ -608,6 +608,10 @@ private class InnerWebSocket: Hashable {
608608
609609 var hashValue : Int { return id }
610610
611+ func hash( into hasher: inout Hasher ) {
612+ hasher. combine ( id)
613+ }
614+
611615 init ( request: URLRequest , subProtocols : [ String ] = [ ] , stub : Bool = false ) {
612616 pthread_mutex_init ( & mutex, nil )
613617 self . id = manager. nextId ( )
@@ -974,8 +978,8 @@ private class InnerWebSocket: Hashable {
974978 }
975979
976980 func closeConn( ) {
977- rd. remove ( from: RunLoop . main, forMode: . default)
978- wr. remove ( from: RunLoop . main, forMode: . default)
981+ rd. remove ( from: RunLoop . main, forMode: RunLoop . Mode . default)
982+ wr. remove ( from: RunLoop . main, forMode: RunLoop . Mode . default)
979983 rd. delegate = nil
980984 wr. delegate = nil
981985 rd. close ( )
@@ -1094,8 +1098,8 @@ private class InnerWebSocket: Hashable {
10941098 }
10951099 rd. delegate = delegate
10961100 wr. delegate = delegate
1097- rd. schedule ( in: RunLoop . main, forMode: . default)
1098- wr. schedule ( in: RunLoop . main, forMode: . default)
1101+ rd. schedule ( in: RunLoop . main, forMode: RunLoop . Mode . default)
1102+ wr. schedule ( in: RunLoop . main, forMode: RunLoop . Mode . default)
10991103 rd. open ( )
11001104 wr. open ( )
11011105 try write ( header, length: header. count)
@@ -1693,7 +1697,8 @@ open class WebSocket: NSObject {
16931697 fileprivate var ws : InnerWebSocket
16941698 fileprivate var id = manager. nextId ( )
16951699 fileprivate var opened : Bool
1696- open override var hashValue : Int { return id }
1700+ open override var hash : Int { return id }
1701+
16971702 /// Create a WebSocket connection to a URL; this should be the URL to which the WebSocket server will respond.
16981703 public convenience init ( _ url: String ) {
16991704 self . init ( request: URLRequest ( url: URL ( string: url) !) , subProtocols: [ ] )
0 commit comments