Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple File Upload Requests #61

Closed
omarojo opened this issue Jun 9, 2019 · 4 comments
Closed

Multiple File Upload Requests #61

omarojo opened this issue Jun 9, 2019 · 4 comments

Comments

@omarojo
Copy link

omarojo commented Jun 9, 2019

Im trying to have 7 iOS devices.
One is the Web Server, the others connect to the server via WebSockets.
So when the Server notifies the clients (via websocket) to take a Photo they all take a photo/video at the same time. and then Upload Image/Video file to Server via AFNetworking/Alamofire

Do you think your library can handle the upload request from 7 clients at the same time, would this happen as a multi-part form data post request ?

Also extra question: Is it possible for the clients to scan the network and find the IP of the server? or maybe use some sort of Bonjour solution?

Thanks. Your Lib looks like the most comprehensive alternative to Kitura,Perfect,Criollo and all the other libraries.

@yvbeek
Copy link
Member

yvbeek commented Jun 12, 2019

In one of my projects I use Telegraph for communication between iPads on a local network. One iPad is the "master" and the other iPads connect to it.

If you are using WebSockets you could use them directly to send the photo / video (as binary data) from the client to the server. The WebSocket will work in both directions and might save you a bit of overhead compared to the requests with AFNetworking or AlamoFire.

In Telegraph I haven't implemented multi-part posts, but with AlamoFire you should be able to post the photo / video as raw data in the body. For more info see this StackOverflow post.

To publish your server on the network you can use a simple Bonjour service. On the side of the server you publish the NetService and on the side of the clients you look for services using a NetServiceBrowser. Below are a few useful links, if you need any help, don't hesitate to let me know.

Server side
https://developer.apple.com/documentation/foundation/netservice
https://developer.apple.com/documentation/foundation/netservice/1416480-publish

Client side
https://developer.apple.com/documentation/foundation/netservicebrowser
https://developer.apple.com/documentation/foundation/netservicebrowser/1417565-searchforservices

@omarojo
Copy link
Author

omarojo commented Jun 13, 2019

oh Wow.. thanks for the detailed reply.

So do you think using Websockets to transfer 7 media files at the same time can be easily handled by the Telegraph server ? is there a way to know if the transfer fails ?

:)

@yvbeek
Copy link
Member

yvbeek commented Jun 13, 2019

It depends a bit on the hardware of the devices that you are going to use, but if the images aren't too big then it shouldn't be a problem.

Some of the implementation in file handling is a bit rough in Telegraph, mainly because of the dependency on CocoaAsyncSocket. So it might eat a bit of memory on your device, but I think it will be the simplest solution to implement.

@yvbeek
Copy link
Member

yvbeek commented Jun 27, 2019

Please let me know if I can be of help here. I'll close the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants