Compare commits
42 Commits
developmen
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a3af2cbba | ||
|
|
24ee358a41 | ||
|
|
8b09fa2e87 | ||
|
|
55d85b7119 | ||
|
|
97d64be723 | ||
|
|
24cc9bf118 | ||
|
|
fadd0e198d | ||
|
|
2e6ba27140 | ||
|
|
cb0af50dbb | ||
|
|
e6c6c4d760 | ||
|
|
c1a7ac522a | ||
|
|
8f7d7cb144 | ||
|
|
e8bf27c467 | ||
|
|
ee34b7a68d | ||
|
|
7cd6d8e846 | ||
|
|
ab16278795 | ||
|
|
31f6a91532 | ||
|
|
f5dd443dba | ||
|
|
fd274a888d | ||
|
|
ecfe786014 | ||
|
|
0c5e36bee8 | ||
|
|
5682b6dd19 | ||
|
|
73c625d1b6 | ||
|
|
c421fa4208 | ||
|
|
02eb90b188 | ||
|
|
cceb04abde | ||
|
|
3131c58dfd | ||
|
|
e0a55fea0e | ||
|
|
bbd4f2ddfe | ||
|
|
fa1d5a6a2f | ||
|
|
46a9ea6746 | ||
|
|
8eadfcd0f0 | ||
|
|
bcc2f3037e | ||
|
|
e488b284d3 | ||
|
|
d706258d94 | ||
|
|
23a4b42d4c | ||
|
|
8032a0fc99 | ||
|
|
a1eb0a5ac0 | ||
|
|
31aa522e9b | ||
|
|
c3e897d571 | ||
|
|
7295b73f62 | ||
|
|
8f5cd72575 |
@ -78,10 +78,10 @@ switch client.connect(timeout: 1) {
|
|||||||
## Server socket example (echo server)
|
## Server socket example (echo server)
|
||||||
``` swift
|
``` swift
|
||||||
func echoService(client: TCPClient) {
|
func echoService(client: TCPClient) {
|
||||||
print("Newclient from:\(c.address)[\(c.port)]")
|
print("Newclient from:\(client.address)[\(client.port)]")
|
||||||
var d = c.read(1024*10)
|
var d = client.read(1024*10)
|
||||||
c.send(data: d!)
|
client.send(data: d!)
|
||||||
c.close()
|
client.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func testServer() {
|
func testServer() {
|
||||||
|
|||||||
@ -32,14 +32,14 @@ import Foundation
|
|||||||
|
|
||||||
@_silgen_name("ytcpsocket_connect") private func c_ytcpsocket_connect(_ host:UnsafePointer<Byte>,port:Int32,timeout:Int32) -> Int32
|
@_silgen_name("ytcpsocket_connect") private func c_ytcpsocket_connect(_ host:UnsafePointer<Byte>,port:Int32,timeout:Int32) -> Int32
|
||||||
@_silgen_name("ytcpsocket_close") private func c_ytcpsocket_close(_ fd:Int32) -> Int32
|
@_silgen_name("ytcpsocket_close") private func c_ytcpsocket_close(_ fd:Int32) -> Int32
|
||||||
|
@_silgen_name("ytcpsocket_bytes_available") private func c_ytcpsocket_bytes_available(_ fd:Int32) -> Int32
|
||||||
@_silgen_name("ytcpsocket_send") private func c_ytcpsocket_send(_ fd:Int32,buff:UnsafePointer<Byte>,len:Int32) -> Int32
|
@_silgen_name("ytcpsocket_send") private func c_ytcpsocket_send(_ fd:Int32,buff:UnsafePointer<Byte>,len:Int32) -> Int32
|
||||||
@_silgen_name("ytcpsocket_pull") private func c_ytcpsocket_pull(_ fd:Int32,buff:UnsafePointer<Byte>,len:Int32,timeout:Int32) -> Int32
|
@_silgen_name("ytcpsocket_pull") private func c_ytcpsocket_pull(_ fd:Int32,buff:UnsafePointer<Byte>,len:Int32,timeout:Int32) -> Int32
|
||||||
@_silgen_name("ytcpsocket_listen") private func c_ytcpsocket_listen(_ address:UnsafePointer<Int8>,port:Int32)->Int32
|
@_silgen_name("ytcpsocket_listen") private func c_ytcpsocket_listen(_ address:UnsafePointer<Int8>,port:Int32)->Int32
|
||||||
@_silgen_name("ytcpsocket_accept") private func c_ytcpsocket_accept(_ onsocketfd:Int32,ip:UnsafePointer<Int8>,port:UnsafePointer<Int32>) -> Int32
|
@_silgen_name("ytcpsocket_accept") private func c_ytcpsocket_accept(_ onsocketfd:Int32,ip:UnsafePointer<Int8>,port:UnsafePointer<Int32>,timeout:Int32) -> Int32
|
||||||
@_silgen_name("ytcpsocket_port") private func c_ytcpsocket_port(_ fd:Int32) -> Int32
|
@_silgen_name("ytcpsocket_port") private func c_ytcpsocket_port(_ fd:Int32) -> Int32
|
||||||
|
|
||||||
open class TCPClient: Socket {
|
open class TCPClient: Socket {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* connect to server
|
* connect to server
|
||||||
* return success or fail with message
|
* return success or fail with message
|
||||||
@ -62,7 +62,7 @@ open class TCPClient: Socket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* close socket
|
* close socket
|
||||||
* return success or fail with message
|
* return success or fail with message
|
||||||
@ -136,6 +136,21 @@ open class TCPClient: Socket {
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gets byte available for reading
|
||||||
|
*/
|
||||||
|
open func bytesAvailable() -> Int32? {
|
||||||
|
guard let fd:Int32 = self.fd else { return nil }
|
||||||
|
|
||||||
|
let bytesAvailable = c_ytcpsocket_bytes_available(fd);
|
||||||
|
|
||||||
|
if (bytesAvailable < 0) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return bytesAvailable
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class TCPServer: Socket {
|
open class TCPServer: Socket {
|
||||||
@ -161,12 +176,12 @@ open class TCPServer: Socket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open func accept() -> TCPClient? {
|
open func accept(timeout :Int32 = 0) -> TCPClient? {
|
||||||
guard let serferfd = self.fd else { return nil }
|
guard let serferfd = self.fd else { return nil }
|
||||||
|
|
||||||
var buff: [Int8] = [Int8](repeating: 0x0,count: 16)
|
var buff: [Int8] = [Int8](repeating: 0x0,count: 16)
|
||||||
var port: Int32 = 0
|
var port: Int32 = 0
|
||||||
let clientfd: Int32 = c_ytcpsocket_accept(serferfd, ip: &buff, port: &port)
|
let clientfd: Int32 = c_ytcpsocket_accept(serferfd, ip: &buff, port: &port, timeout: timeout)
|
||||||
|
|
||||||
guard clientfd >= 0 else { return nil }
|
guard clientfd >= 0 else { return nil }
|
||||||
guard let address = String(cString: buff, encoding: String.Encoding.utf8) else { return nil }
|
guard let address = String(cString: buff, encoding: String.Encoding.utf8) else { return nil }
|
||||||
|
|||||||
@ -111,6 +111,26 @@ open class UDPClient: Socket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO add multycast and boardcast
|
||||||
|
open func recv(_ expectlen: Int) -> ([Byte]?, String, Int) {
|
||||||
|
guard let fd = self.fd else {
|
||||||
|
return (nil, "no ip", 0)
|
||||||
|
}
|
||||||
|
let buff: [Byte] = [Byte](repeating: 0x0, count: expectlen)
|
||||||
|
var remoteipbuff: [Int8] = [Int8](repeating: 0x0, count: 16)
|
||||||
|
var remoteport: Int32 = 0
|
||||||
|
let readLen: Int32 = c_yudpsocket_recive(fd, buff: buff, len: Int32(expectlen), ip: &remoteipbuff, port: &remoteport)
|
||||||
|
let port: Int = Int(remoteport)
|
||||||
|
let address = String(cString: remoteipbuff, encoding: String.Encoding.utf8) ?? ""
|
||||||
|
|
||||||
|
if readLen <= 0 {
|
||||||
|
return (nil, address, port)
|
||||||
|
}
|
||||||
|
|
||||||
|
let data: [Byte] = Array(buff[0..<Int(readLen)])
|
||||||
|
return (data, address, port)
|
||||||
|
}
|
||||||
|
|
||||||
open func close() {
|
open func close() {
|
||||||
guard let fd = self.fd else { return }
|
guard let fd = self.fd else { return }
|
||||||
|
|
||||||
@ -134,7 +154,7 @@ open class UDPServer: Socket {
|
|||||||
//TODO add multycast and boardcast
|
//TODO add multycast and boardcast
|
||||||
open func recv(_ expectlen: Int) -> ([Byte]?, String, Int) {
|
open func recv(_ expectlen: Int) -> ([Byte]?, String, Int) {
|
||||||
if let fd = self.fd {
|
if let fd = self.fd {
|
||||||
var buff: [Byte] = [Byte](repeating: 0x0,count: expectlen)
|
let buff: [Byte] = [Byte](repeating: 0x0,count: expectlen)
|
||||||
var remoteipbuff: [Int8] = [Int8](repeating: 0x0,count: 16)
|
var remoteipbuff: [Int8] = [Int8](repeating: 0x0,count: 16)
|
||||||
var remoteport: Int32 = 0
|
var remoteport: Int32 = 0
|
||||||
let readLen: Int32 = c_yudpsocket_recive(fd, buff: buff, len: Int32(expectlen), ip: &remoteipbuff, port: &remoteport)
|
let readLen: Int32 = c_yudpsocket_recive(fd, buff: buff, len: Int32(expectlen), ip: &remoteipbuff, port: &remoteport)
|
||||||
|
|||||||
@ -37,12 +37,14 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
void ytcpsocket_set_block(int socket, int on) {
|
void ytcpsocket_set_block(int socket, int on) {
|
||||||
int flags;
|
int flags;
|
||||||
@ -93,7 +95,6 @@ int ytcpsocket_connect(const char *host, int port, int timeout) {
|
|||||||
return -4;//connect fail
|
return -4;//connect fail
|
||||||
}
|
}
|
||||||
|
|
||||||
ytcpsocket_set_block(sockfd, 1);
|
|
||||||
int set = 1;
|
int set = 1;
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
|
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
|
||||||
return sockfd;
|
return sockfd;
|
||||||
@ -105,6 +106,8 @@ int ytcpsocket_close(int socketfd){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ytcpsocket_pull(int socketfd, char *data, int len, int timeout_sec) {
|
int ytcpsocket_pull(int socketfd, char *data, int len, int timeout_sec) {
|
||||||
|
int readlen = 0;
|
||||||
|
int datalen = 0;
|
||||||
if (timeout_sec > 0) {
|
if (timeout_sec > 0) {
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@ -117,8 +120,26 @@ int ytcpsocket_pull(int socketfd, char *data, int len, int timeout_sec) {
|
|||||||
return ret; // select-call failed or timeout occurred (before anything was sent)
|
return ret; // select-call failed or timeout occurred (before anything was sent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int readlen = (int)read(socketfd, data, len);
|
// use loop to make sure receive all data
|
||||||
return readlen;
|
do {
|
||||||
|
readlen = (int)read(socketfd, data + datalen, len - datalen);
|
||||||
|
if (readlen > 0) {
|
||||||
|
datalen += readlen;
|
||||||
|
}
|
||||||
|
} while (readlen > 0);
|
||||||
|
|
||||||
|
return datalen;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ytcpsocket_bytes_available(int socketfd) {
|
||||||
|
int count;
|
||||||
|
int callResult = ioctl(socketfd, FIONREAD, &count);
|
||||||
|
|
||||||
|
if (callResult < 0) {
|
||||||
|
return callResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ytcpsocket_send(int socketfd, const char *data, int len){
|
int ytcpsocket_send(int socketfd, const char *data, int len){
|
||||||
@ -159,15 +180,31 @@ int ytcpsocket_listen(const char *address, int port) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//return client socket fd
|
//return client socket fd
|
||||||
int ytcpsocket_accept(int onsocketfd, char *remoteip, int *remoteport) {
|
int ytcpsocket_accept(int onsocketfd, char *remoteip, int *remoteport, int timeouts) {
|
||||||
socklen_t clilen;
|
socklen_t clilen;
|
||||||
struct sockaddr_in cli_addr;
|
struct sockaddr_in cli_addr;
|
||||||
clilen = sizeof(cli_addr);
|
clilen = sizeof(cli_addr);
|
||||||
|
fd_set fdset;
|
||||||
|
FD_ZERO(&fdset);
|
||||||
|
FD_SET(onsocketfd, &fdset);
|
||||||
|
struct timeval *timeptr = NULL;
|
||||||
|
struct timeval timeout;
|
||||||
|
if (timeouts > 0) {
|
||||||
|
timeout.tv_sec = timeouts;
|
||||||
|
timeout.tv_usec = 0;
|
||||||
|
timeptr = &timeout;
|
||||||
|
}
|
||||||
|
int status = select(FD_SETSIZE, &fdset, NULL, NULL, timeptr);
|
||||||
|
if (status != 1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
int newsockfd = accept(onsocketfd, (struct sockaddr *) &cli_addr, &clilen);
|
int newsockfd = accept(onsocketfd, (struct sockaddr *) &cli_addr, &clilen);
|
||||||
char *clientip=inet_ntoa(cli_addr.sin_addr);
|
char *clientip=inet_ntoa(cli_addr.sin_addr);
|
||||||
memcpy(remoteip, clientip, strlen(clientip));
|
memcpy(remoteip, clientip, strlen(clientip));
|
||||||
*remoteport = cli_addr.sin_port;
|
*remoteport = cli_addr.sin_port;
|
||||||
if (newsockfd > 0) {
|
if (newsockfd > 0) {
|
||||||
|
int set = 1;
|
||||||
|
setsockopt(newsockfd, SOL_SOCKET, SO_NOSIGPIPE, (void*) &set, sizeof(int));
|
||||||
return newsockfd;
|
return newsockfd;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -48,6 +48,7 @@ int yudpsocket_server(const char *address, int port) {
|
|||||||
|
|
||||||
//bind
|
//bind
|
||||||
struct sockaddr_in serv_addr;
|
struct sockaddr_in serv_addr;
|
||||||
|
memset( &serv_addr, '\0', sizeof(serv_addr));
|
||||||
serv_addr.sin_len = sizeof(struct sockaddr_in);
|
serv_addr.sin_len = sizeof(struct sockaddr_in);
|
||||||
serv_addr.sin_family = AF_INET;
|
serv_addr.sin_family = AF_INET;
|
||||||
if (address == NULL || strlen(address) == 0 || strcmp(address, "255.255.255.255") == 0) {
|
if (address == NULL || strlen(address) == 0 || strcmp(address, "255.255.255.255") == 0) {
|
||||||
@ -58,7 +59,6 @@ int yudpsocket_server(const char *address, int port) {
|
|||||||
r = setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));
|
r = setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));
|
||||||
serv_addr.sin_addr.s_addr = inet_addr(address);
|
serv_addr.sin_addr.s_addr = inet_addr(address);
|
||||||
serv_addr.sin_port = htons(port);
|
serv_addr.sin_port = htons(port);
|
||||||
memset( &serv_addr, '\0', sizeof(serv_addr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r == -1) {
|
if (r == -1) {
|
||||||
@ -95,6 +95,10 @@ int yudpsocket_client() {
|
|||||||
int socketfd = socket(AF_INET, SOCK_DGRAM, 0);
|
int socketfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
int reuseon = 1;
|
int reuseon = 1;
|
||||||
setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));
|
setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));
|
||||||
|
|
||||||
|
//disable SIGPIPE as we'll handle send errors ourselves
|
||||||
|
int noSigPipe = 1;
|
||||||
|
setsockopt(socketfd, SOL_SOCKET, SO_NOSIGPIPE, &noSigPipe, sizeof(noSigPipe));
|
||||||
|
|
||||||
return socketfd;
|
return socketfd;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
|
|
||||||
s.name = 'SwiftSocket'
|
s.name = 'SwiftSocket'
|
||||||
s.version = '2.0.1'
|
s.version = '2.0.2'
|
||||||
s.summary = 'A cool framework to work with TCP and UDP sockets'
|
s.summary = 'A cool framework to work with TCP and UDP sockets'
|
||||||
|
|
||||||
s.description = <<-DESC
|
s.description = <<-DESC
|
||||||
SwiftSocket profieds an easy way to create TCP or UDP clients and servers 💁
|
SwiftSocket provides an easy way to create TCP or UDP clients and servers 💁
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
s.homepage = 'https://github.com/swiftsocket/SwiftSocket'
|
s.homepage = 'https://github.com/swiftsocket/SwiftSocket'
|
||||||
@ -23,6 +23,6 @@ Pod::Spec.new do |s|
|
|||||||
:tag => s.version
|
:tag => s.version
|
||||||
}
|
}
|
||||||
s.source_files = 'Sources/**/*.{swift,c}'
|
s.source_files = 'Sources/**/*.{swift,c}'
|
||||||
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3' }
|
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5' }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -273,11 +273,12 @@
|
|||||||
attributes = {
|
attributes = {
|
||||||
LastSwiftMigration = 0710;
|
LastSwiftMigration = 0710;
|
||||||
LastSwiftUpdateCheck = 0810;
|
LastSwiftUpdateCheck = 0810;
|
||||||
LastUpgradeCheck = 0710;
|
LastUpgradeCheck = 1020;
|
||||||
ORGANIZATIONNAME = swift;
|
ORGANIZATIONNAME = swift;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
37454EC91E06158200800AE5 = {
|
37454EC91E06158200800AE5 = {
|
||||||
CreatedOnToolsVersion = 8.2;
|
CreatedOnToolsVersion = 8.2;
|
||||||
|
LastSwiftMigration = 1020;
|
||||||
ProvisioningStyle = Manual;
|
ProvisioningStyle = Manual;
|
||||||
};
|
};
|
||||||
375C482C1DDC4C56008C701D = {
|
375C482C1DDC4C56008C701D = {
|
||||||
@ -286,18 +287,19 @@
|
|||||||
};
|
};
|
||||||
377DAA681DCDE40200009697 = {
|
377DAA681DCDE40200009697 = {
|
||||||
CreatedOnToolsVersion = 8.1;
|
CreatedOnToolsVersion = 8.1;
|
||||||
LastSwiftMigration = 0810;
|
LastSwiftMigration = 1020;
|
||||||
ProvisioningStyle = Manual;
|
ProvisioningStyle = Manual;
|
||||||
};
|
};
|
||||||
377DAA751DCDE45D00009697 = {
|
377DAA751DCDE45D00009697 = {
|
||||||
CreatedOnToolsVersion = 8.1;
|
CreatedOnToolsVersion = 8.1;
|
||||||
|
LastSwiftMigration = 1020;
|
||||||
ProvisioningStyle = Manual;
|
ProvisioningStyle = Manual;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 5518C82A19A3290F0049DC22 /* Build configuration list for PBXProject "SwiftSocket" */;
|
buildConfigurationList = 5518C82A19A3290F0049DC22 /* Build configuration list for PBXProject "SwiftSocket" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = English;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
en,
|
en,
|
||||||
@ -445,8 +447,8 @@
|
|||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
@ -477,8 +479,8 @@
|
|||||||
SDKROOT = appletvos;
|
SDKROOT = appletvos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
@ -502,7 +504,7 @@
|
|||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -525,7 +527,7 @@
|
|||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
};
|
};
|
||||||
@ -559,7 +561,7 @@
|
|||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
@ -593,7 +595,7 @@
|
|||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
@ -621,7 +623,7 @@
|
|||||||
PRODUCT_NAME = SwiftSocket;
|
PRODUCT_NAME = SwiftSocket;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
};
|
};
|
||||||
@ -647,7 +649,7 @@
|
|||||||
PRODUCT_NAME = SwiftSocket;
|
PRODUCT_NAME = SwiftSocket;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@ -658,17 +660,28 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
@ -676,6 +689,7 @@
|
|||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
"DEBUG=1",
|
"DEBUG=1",
|
||||||
@ -695,7 +709,7 @@
|
|||||||
PRODUCT_NAME = "";
|
PRODUCT_NAME = "";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@ -703,23 +717,35 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
@ -731,7 +757,8 @@
|
|||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
PRODUCT_NAME = "";
|
PRODUCT_NAME = "";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SWIFT_VERSION = 3.0;
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0820"
|
LastUpgradeVersion = "1020"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0820"
|
LastUpgradeVersion = "1020"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0820"
|
LastUpgradeVersion = "1020"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|||||||
@ -12,9 +12,8 @@ import UIKit
|
|||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
var window: UIWindow?
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user