Differences From Artifact [ac74ecd3ae]:
- File src/OFRunLoop.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 34144) [annotate] [blame] [check-ins using] [more...]
To Artifact [b3743d07b5]:
- File
src/OFRunLoop.m
— part of check-in
[3dfe642dd3]
at
2020-04-24 00:21:43
on branch trunk
— Add OFIPStreamSocket
This is a new superclass for OFTCPSocket to allow sharing code with
other IP stream socket types, namely SCTP. (user: js, size: 34180) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
23 24 25 26 27 28 29 | #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFArray.h" #import "OFData.h" #import "OFDictionary.h" #ifdef OF_HAVE_SOCKETS # import "OFKernelEventObserver.h" | | | | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFArray.h" #import "OFData.h" #import "OFDictionary.h" #ifdef OF_HAVE_SOCKETS # import "OFKernelEventObserver.h" # import "OFIPStreamSocket.h" # import "OFIPStreamSocket+Private.h" #endif #import "OFThread.h" #ifdef OF_HAVE_THREADS # import "OFMutex.h" # import "OFCondition.h" #endif #import "OFSortedList.h" |
︙ | ︙ | |||
153 154 155 156 157 158 159 | @end # endif @interface OFRunLoopAcceptQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS | | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | @end # endif @interface OFRunLoopAcceptQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS of_ip_stream_socket_async_accept_block_t _block; # endif } @end @interface OFRunLoopUDPReceiveQueueItem: OFRunLoopQueueItem { @public |
︙ | ︙ | |||
731 732 733 734 735 736 737 | } @end # endif @implementation OFRunLoopAcceptQueueItem - (bool)handleObject: (id)object { | | | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | } @end # endif @implementation OFRunLoopAcceptQueueItem - (bool)handleObject: (id)object { OFIPStreamSocket *acceptedSocket; id exception = nil; @try { acceptedSocket = [object accept]; } @catch (id e) { acceptedSocket = nil; exception = e; |
︙ | ︙ | |||
1048 1049 1050 1051 1052 1053 1054 | queueItem->_string = [string copy]; queueItem->_encoding = encoding; QUEUE_ITEM } # if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) | | | | < | | | | | 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | queueItem->_string = [string copy]; queueItem->_encoding = encoding; QUEUE_ITEM } # if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) + (void)of_addAsyncConnectForIPStreamSocket: (OFIPStreamSocket *)stream mode: (of_run_loop_mode_t)mode delegate: (id <OFIPStreamSocketDelegate_Private>)delegate { NEW_WRITE(OFRunLoopConnectQueueItem, stream, mode) queueItem->_delegate = [delegate retain]; QUEUE_ITEM } # endif + (void)of_addAsyncAcceptForIPStreamSocket: (OFIPStreamSocket *)stream mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS block: (of_ip_stream_socket_async_accept_block_t)block # endif delegate: (id <OFIPStreamSocketDelegate>)delegate { NEW_READ(OFRunLoopAcceptQueueItem, stream, mode) queueItem->_delegate = [delegate retain]; # ifdef OF_HAVE_BLOCKS queueItem->_block = [block copy]; # endif |
︙ | ︙ |