Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

- add SWS prefix to WebSocket class name #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Source/WebSocket.swift → Source/SWSWebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1651,14 +1651,14 @@ private let manager = Manager()

/// WebSocket objects are bidirectional network streams that communicate over HTTP. RFC 6455.
@objcMembers
open class WebSocket: NSObject {
open class SWSWebSocket: NSObject {
fileprivate var ws: InnerWebSocket
fileprivate var id = manager.nextId()
fileprivate var opened: Bool

open override var hash: Int { return id }
open override func isEqual(_ other: Any?) -> Bool {
guard let other = other as? WebSocket else { return false }
guard let other = other as? SWSWebSocket else { return false }
return self.id == other.id
}

Expand Down Expand Up @@ -1811,11 +1811,11 @@ open class WebSocket: NSObject {
}
}

public func ==(lhs: WebSocket, rhs: WebSocket) -> Bool {
public func ==(lhs: SWSWebSocket, rhs: SWSWebSocket) -> Bool {
return lhs.id == rhs.id
}

extension WebSocket {
extension SWSWebSocket {
/// The events of the WebSocket using a delegate.
@objc
public var delegate : WebSocketDelegate? {
Expand Down
16 changes: 8 additions & 8 deletions SwiftWebSocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
031967101B4D96C40033860E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* WebSocket.swift */; };
03285D2B1B4A9F1A0078A1AA /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* WebSocket.swift */; };
031967101B4D96C40033860E /* SWSWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* SWSWebSocket.swift */; };
03285D2B1B4A9F1A0078A1AA /* SWSWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* SWSWebSocket.swift */; };
03957A461C5A734C005CC1DB /* SwiftWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = D71948F11B35E5670015C529 /* SwiftWebSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
03957A471C5A7392005CC1DB /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* WebSocket.swift */; };
03957A471C5A7392005CC1DB /* SWSWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03285D2A1B4A9F1A0078A1AA /* SWSWebSocket.swift */; };
03957A4C1C5A7532005CC1DB /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 03957A4B1C5A7532005CC1DB /* libz.dylib */; };
03D1E7221B208A5C00AC49AC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 03D1E7211B208A5C00AC49AC /* libz.dylib */; };
03D70CD11BDAC5EC00D245C3 /* SwiftWebSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D71949011B35E6130015C529 /* SwiftWebSocket.framework */; };
Expand Down Expand Up @@ -51,7 +51,7 @@

/* Begin PBXFileReference section */
0319670F1B4D96B80033860E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03285D2A1B4A9F1A0078A1AA /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocket.swift; sourceTree = "<group>"; };
03285D2A1B4A9F1A0078A1AA /* SWSWebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWSWebSocket.swift; sourceTree = "<group>"; };
03957A3C1C5A71DB005CC1DB /* SwiftWebSocket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftWebSocket.framework; sourceTree = BUILT_PRODUCTS_DIR; };
03957A481C5A74D9005CC1DB /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = "<group>"; };
03957A4B1C5A7532005CC1DB /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };
Expand Down Expand Up @@ -164,7 +164,7 @@
03957A481C5A74D9005CC1DB /* Info-tvOS.plist */,
0319670F1B4D96B80033860E /* Info.plist */,
D71948F11B35E5670015C529 /* SwiftWebSocket.h */,
03285D2A1B4A9F1A0078A1AA /* WebSocket.swift */,
03285D2A1B4A9F1A0078A1AA /* SWSWebSocket.swift */,
);
path = Source;
sourceTree = "<group>";
Expand Down Expand Up @@ -423,15 +423,15 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03957A471C5A7392005CC1DB /* WebSocket.swift in Sources */,
03957A471C5A7392005CC1DB /* SWSWebSocket.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
03D1E6FE1B20897100AC49AC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03285D2B1B4A9F1A0078A1AA /* WebSocket.swift in Sources */,
03285D2B1B4A9F1A0078A1AA /* SWSWebSocket.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -455,7 +455,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
031967101B4D96C40033860E /* WebSocket.swift in Sources */,
031967101B4D96C40033860E /* SWSWebSocket.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions Test-ObjectiveC/Connection.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ @interface Connection () <WebSocketDelegate>
@end

@implementation Connection {
WebSocket *_webSocket;
SWSWebSocket *_webSocket;
}

- (instancetype)init {
Expand All @@ -25,7 +25,7 @@ - (instancetype)init {
}

- (void)open {
_webSocket = [[WebSocket alloc] init:@"ws://localhost:9000"];
_webSocket = [[SWSWebSocket alloc] init:@"ws://localhost:9000"];
_webSocket.delegate = self;
[_webSocket open];
NSAssert(_webSocket.readyState == WebSocketReadyStateConnecting, @"WebSocket is not connecting");
Expand Down