@@ -61,11 +61,11 @@ #import "of_asprintf.h" #define MIN_READ_SIZE 512 @implementation OFStream -@synthesize of_waitingForDelimiter = _waitingForDelimiter; +@synthesize of_waitingForDelimiter = _waitingForDelimiter, delegate = _delegate; #if defined(SIGPIPE) && defined(SIG_IGN) + (void)initialize { if (self == [OFStream class]) @@ -195,72 +195,50 @@ } #ifdef OF_HAVE_SOCKETS - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length - target: (id)target - selector: (SEL)selector - context: (id)context { [self asyncReadIntoBuffer: buffer length: length - runLoopMode: of_run_loop_mode_default - target: target - selector: selector - context: context]; + runLoopMode: of_run_loop_mode_default]; } - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - target: (id)target - selector: (SEL)selector - context: (id)context { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadForStream: stream buffer: buffer length: length mode: runLoopMode - target: target - selector: selector - context: context]; + delegate: _delegate]; } - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length - target: (id)target - selector: (SEL)selector - context: (id)context { [self asyncReadIntoBuffer: buffer exactLength: length - runLoopMode: of_run_loop_mode_default - target: target - selector: selector - context: context]; + runLoopMode: of_run_loop_mode_default]; } - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - target: (id)target - selector: (SEL)selector - context: (id)context { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadForStream: stream buffer: buffer exactLength: length mode: runLoopMode - target: target - selector: selector - context: context]; + delegate: _delegate]; } # ifdef OF_HAVE_BLOCKS - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length @@ -886,48 +864,32 @@ return line; } #ifdef OF_HAVE_SOCKETS -- (void)asyncReadLineWithTarget: (id)target - selector: (SEL)selector - context: (id)context +- (void)asyncReadLine { [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8 - runLoopMode: of_run_loop_mode_default - target: target - selector: selector - context: context]; + runLoopMode: of_run_loop_mode_default]; } - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding - target: (id)target - selector: (SEL)selector - context: (id)context { [self asyncReadLineWithEncoding: encoding - runLoopMode: of_run_loop_mode_default - target: target - selector: selector - context: context]; + runLoopMode: of_run_loop_mode_default]; } - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding runLoopMode: (of_run_loop_mode_t)runLoopMode - target: (id)target - selector: (SEL)selector - context: (id)context { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadLineForStream: stream encoding: encoding mode: runLoopMode - target: target - selector: selector - context: context]; + delegate: _delegate]; } # ifdef OF_HAVE_BLOCKS - (void)asyncReadLineWithBlock: (of_stream_async_read_line_block_t)block { @@ -1204,39 +1166,28 @@ } #ifdef OF_HAVE_SOCKETS - (void)asyncWriteBuffer: (const void *)buffer length: (size_t)length - target: (id)target - selector: (SEL)selector - context: (id)context { [self asyncWriteBuffer: buffer length: length - runLoopMode: of_run_loop_mode_default - target: target - selector: selector - context: context]; + runLoopMode: of_run_loop_mode_default]; } - (void)asyncWriteBuffer: (const void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - target: (id)target - selector: (SEL)selector - context: (id)context { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncWriteForStream: stream buffer: buffer length: length mode: runLoopMode - target: target - selector: selector - context: context]; + delegate: _delegate]; } # ifdef OF_HAVE_BLOCKS - (void)asyncWriteBuffer: (const void *)buffer length: (size_t)length