Code Monkey home page Code Monkey logo

fastsocket's People

Contributors

babysnakes42 avatar dreese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastsocket's Issues

timeout cannot be for less than 1 second

  • (BOOL)setTimeout:(long)seconds Should take a float instead of a long. It should calculate the number of microseconds and pass those to the struct timeval.

Without this functionality it's impossible to have a fast poling socket applicaiton

Send File.

How can i get sended bytes when transfering is on.Because i want to show progress bar.

How to send a NSString object to server?

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?

EXC_GUARD

2015-07-27 3 46 04

my app crashed many times, look at the pic, thank you very much

UDP Text greater than 1388 bytes gets cut off

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!

TCP_NODELAY not defined

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

How to terminate the progress of receiveBytes:count method?

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?

Receive raw bytes as NSString

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?

Unable to build FastSocket on Xcode 9.0 (9A235)

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.

How can I keep waiting to receive bytes from the server using receiveBytes method?

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

  • (long)receiveBytes:(void *)buf limit:(long)limit or
  • (BOOL)receiveBytes:(void *)buf count:(long)count

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.

Sockfd not to 0

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.