63 questions
1
vote
3
answers
90
views
Is it safe to transform a struct directly to Data
The lcl-ping library on GitHub has the following definition of an ICMPHeader struct:
internal struct ICMPHeader {
/// ICMP message type (ECHO_REQUEST)
let type: UInt8
let code: UInt8
...
0
votes
1
answer
166
views
Can I connect to a Swift gRPC server over a local network via Bonjour (zeroconf)?
I am working on an iOS app where one device will act as the server and other devices on the same local network will connect to the server device. I would like to use Bonjour for the clients to ...
-2
votes
1
answer
217
views
Swift binary built in docker causes "illegal instruction" crash on real Linux
I'm building a server app written in Swift and am trying to deploy it on Linux for the first time. I'm generally following this guide and some others found on the internet.
My docker command is:
...
2
votes
0
answers
152
views
Calling URL request with private and public key
For Vapor script that runs on Linux I need to make a request that corresponds to following cURL but as of now, I was unable to find the best solution for this.
curl -X GET \
https://endpoint \
--...
0
votes
0
answers
977
views
What about my Swift-NIO-SSL handshake is failing?
I am trying to figure out what about my TLS handshake is failing. I am not exactly sure what this error code means. Can someone provide more context here?
2000-00-00T00:00:00-0000 error [[GRPC-LOGG]] :...
0
votes
0
answers
411
views
Swift build for linux/amd64 fails with strange error
I have a swift app with the following dependencies:
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.41.1")),
.package(url: "https://...
0
votes
1
answer
84
views
Property does not persist in array?
My goal is to persist a swift-nio Scheduled instance in a struct named Receiver in an array to potentially use later. It creates the Receiver, stores it in the array and adds the Scheduled instance, ...
0
votes
1
answer
261
views
Appropriate background mode for Swift NIO client
I've created an iOS app, that connects to an embedded device using swift-nio-ssh. This app has no UI to control the device, as that is supposed to be done with a Watch app, using WatchConnectivity.
As ...
5
votes
1
answer
2k
views
Vapor Swift How to Configure Client Connection Timeout
I am using Vapor Swift to send GET / POST requests from the server-side using the below methods:
req.application.client.get(<#T##url: URI##URI#>, headers: <#T##HTTPHeaders#>, beforeSend: &...
0
votes
1
answer
307
views
How to transfer data between SwiftNIO TCP-server and Python based TCP-client?
I have a TCP server written in SwiftNIO, based on this documentation.
I want my client to be written in python from which I can send multiple JSON strings & can receive similar/different multiple ...
0
votes
1
answer
763
views
Is is possible to open SwiftNIO based server socket within XCTest test app?
I have an XCTest which works with UI components. I tried to open a server socket within the xctext function using SwiftNIO.
I took the echo server example from here. and I simplified, removed the args ...
1
vote
1
answer
1k
views
Swift Vapor 4 upload , validate , resize an image file
I am trying to post a photo to the vapor 4 server.
I am sending a Team name as a string and an image as data.
struct SendTeam: Content {
var name: String
var img: Data
}
I want to upload the ...
0
votes
1
answer
342
views
Handle Swift-nio server-side TCP connection event and send context data to client
I'm working on a COPS (rfc 2748) protocol handler. I need to be able to send a message from the server to the client immediately after a TCP connection is established. I'm not finding any API that ...
1
vote
1
answer
499
views
channelRead not being called in Swift-NIO Datagram's ChannelInboundHandler
I am trying to capture a UDP video stream within a (fresh) vapor application running in Xcode. The data is being streamed by ffmpeg and I can successfully view the stream on the target machine using ...
1
vote
0
answers
367
views
Apple Secure Transport API is deprecated, what alternatives are there
Hi according to this the API is deprecated and considered legacy. It is not specific about when it will be removed. They recommend using Network, though it doesn't have a low-level API for alternative ...
5
votes
2
answers
2k
views
How do I get `Data` objects into Swift-NIO without making copies?
I'm fairly new to Swift and very new to NIO.
I'm adding Swift code to a large project that needs to up/down load a lot of data (GBs) to AWS. To that end, I've imported the GitHub project Soto, which ...
0
votes
1
answer
401
views
Swift NIO EventLoopFuture chain not completing
I have a very simple service built on a Vapor app. The service consumes data from another family of services. Obviously this is just the sort of application the map methods were made for.
All the ...
0
votes
1
answer
390
views
SwiftNIO: Sent package partially received
I have developed a client and a server using swift nio, I have no problems sending package of all size between 12 and 1000bytes since server sends a pack of 528bytes and when client got it, it is ...
0
votes
2
answers
737
views
Write a CircularBuffer (swift-nio) to a file in Swift using OutputStream?
I am trying to use a CircularBuffer<UInt8> from SwiftNIO to store data and once the buffer is almost full dump the contents to a file using an OutputStream. Unfortunately, the OutputStream.write(...
0
votes
1
answer
809
views
Can I use SwiftNIO client websocket with different server websocket?
I am new to WebSocket, choosing between https://github.com/daltoniam/Starscream and SwiftNIO,
With SwiftNIO couldn't find clear guidelines, can I Use just SwiftNIO client WebSocket in iOS. and the ...
1
vote
1
answer
682
views
iOS 13 Certificate Pinning with Weak Cipher stopped working But works fine in iOS 12
I am curious into the Passing Weak Cipher through NWProtocolTLS.Options(). Because its working fine in iOS 12 but on iOS 13 Apple they did some changes I guess so it is stopped taking it.
One thing ...
2
votes
2
answers
2k
views
Getting all values for [EventLoopFuture] before proceeding
I have an array of values I map to multiple promises that give me each a EventLoopFuture. So I end up with a method that has a variable-size [EventLoopFuture], and I need all the responses to succeed ...
3
votes
2
answers
819
views
Chained Throwing Futures in SwiftNIO & Vapor
In Vapor 4, I'm processing a post request by calling a request on a 3rd party API and returning a value based on the result I get back. The following code results in the error: "Invalid conversion ...
1
vote
0
answers
391
views
Swift Digest Authentication async-http-client
I am trying to create a digest authentication using swift on top of swiftNIO.
At the end I get the following error: The operation couldn’t be completed. (NIO.NIOConnectionError error 1.)
Here my way ...
0
votes
1
answer
272
views
Digest Authentication using async-http-client
I am trying to implement digest authentication using async-http-client on top of swiftNIO. Therefore I use a class which uses the HTTPClientResponseDelegate protocol. In this class in the
func ...