dreese / fastsocket Goto Github PK
View Code? Open in Web Editor NEWHigh-throughput, synchronous Objective-C wrapper around BSD sockets for iOS and macOS.
License: MIT License
High-throughput, synchronous Objective-C wrapper around BSD sockets for iOS and macOS.
License: MIT License
struct timeval
.Without this functionality it's impossible to have a fast poling socket applicaiton
https://docs.travis-ci.com/user/getting-started/
There is a Readme badge for it too.
How can i get sended bytes when transfering is on.Because i want to show progress bar.
Suppost I have a NSString object say,
NSString *str = @"001" ;
How can I send the NSString to server? By sendBytes: count: or sendFile: method?
I tried to break the NSString into char array by [str UTF8String] method, but I cannot assign it to the char array. Any suggestion that can help?
I'm brand new to this but I was wondering if the maximum amount of bytes to be sent from a UDP server to the iPhone was 1388? I'm trying to send a large file of XML text. I'm using this:
char data[1000000];
long received = [client receiveBytes:data limit:1000000];
NSLog(@"DATA: %s", data);
Is there a way to make the data limit the exact amount of chars being sent from the UDP server to the iPhone? Thanks!
While using XCode 4.1 on Mac OS X 10.6, I was getting an "undeclared identifier: TCP_NODELAY" in FastSocket.m. Please add #include <netinet/tcp.h> to the file.
Thanks,
J
http://daniel.haxx.se/docs/poll-vs-select.html
select() only supports 1024 open sockets.
Let say I need to keep receive data from server
while (1) {
char data[100] ;
[client receiveBytes:data count:100] ;
NSLog(@"%s", data) ;
sleep(2) ;
}
But when [client receiveBytes:data count:100] ; get called, the main queue stop until the data is received, but how can I terminate this method? Since I tried use a if-iteration before calling receiveBytes:count method like:
if ([client isConnected] )
[client receiveBytes:data count:100] ;
But it still cant terminate the receiveBytes:count method, am I need to use setTimeout: method?
How is this possible? I only get data in long (the amount of bytes received), not the actual text. Can it be put into NSString format?
Error
in FastSocket.m:426
Declaration of 'select' must be imported from module 'Darwin.POSIX.sys.time' before it is required Implicit declaration of function 'select' is invalid in C99
Solution
The following import solved the problem for me:
#include <sys/time.h>
Stumbled upon a solved ticket (blinksh/blink#336) reporting the same problem in a different project.
@dreese Thx for fast-socket!Is there a way to set timeout for connect call? setTimeout is not working for me. Is this only for socket server?
The lowercase with dashes way of naming seems to be non-standard. I'd like to do this before publishing the CocoaPod spec.
Having a separate CHANGELOG
file leads to a CocoaPods page with two tabs at the top. See:
https://cocoapods.org/pods/OHHTTPStubs/
Also, as the change log gets longer, it takes up a lot more of the space that should be devoted to how to use the current version of the library.
Some suggestions from:
http://clayallsopp.github.io/readme-score/
Consider adding:
I can not find that how to send integer or short integer. Please tell me that, thanks...
Hi! @dreese
Can you help me?
Jack
Hi, first of all, this is a very good library and suit my application perfectly. I build a vb.net program as a server using socket, and I have three iPod touch which using fast-socket as client.
Everything working fine, but I want to ask, if there any way that I can wait until server send me bytes while I was using
I used to use a do-while loop to loop through this method, but the CPU usage will go to 100% when I'm doing this.
So, I want to ask if there is a method I can wait (sleep in background) until receive message? I research in google that something like FIONBIO property on TCP socket can do so, but can I set some property like this on fast-socket?
Thanks for the great help.
Hello,
Firstly, thantks for your verry usefull classes. I've just one remark, please put sockfd to 0 in init like you've done in close. It could help others.
To test if socket is connected or no i'mchecking sockfd value, but if hasn't been set to 0 defaultly we can't know if connection has been opened or no.
Thanks in advance.
Clem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.