Differences From Artifact [c63329fd4a]:
- File
src/OFStream.m
— part of check-in
[b02c4b05bb]
at
2020-04-25 17:05:13
on branch trunk
— Add OFDatagramSocket as base class for OFUDPSocket
This makes it easier to reuse code for other datagram sockets, namely
IPX. (user: js, size: 40740) [annotate] [blame] [check-ins using]
To Artifact [dd10e2b21b]:
- File src/OFStream.m — part of check-in [bc67e98833] at 2020-05-06 00:32:10 on branch trunk — Improve names of several properties (user: js, size: 40667) [annotate] [blame] [check-ins using] [more...]
︙ | |||
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + - + | #import "OFWriteFailedException.h" #import "of_asprintf.h" #define MIN_READ_SIZE 512 @implementation OFStream @synthesize buffersWrites = _buffersWrites; @synthesize of_waitingForDelimiter = _waitingForDelimiter, delegate = _delegate; #if defined(SIGPIPE) && defined(SIG_IGN) + (void)initialize { if (self == [OFStream class]) signal(SIGPIPE, SIG_IGN); } #endif - (instancetype)init { self = [super init]; @try { if (self.class == [OFStream class]) { [self doesNotRecognizeSelector: _cmd]; abort(); } |
︙ | |||
1124 1125 1126 1127 1128 1129 1130 | 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 | - - - - - - - - - - - + - + | - (OFString *)tryReadTillDelimiter: (OFString *)delimiter { return [self tryReadTillDelimiter: delimiter encoding: OF_STRING_ENCODING_UTF_8]; } |
︙ | |||
1796 1797 1798 1799 1800 1801 1802 | 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 | - + - + - + - + | } - (bool)hasDataInReadBuffer { return (_readBufferLength > 0); } |
︙ | |||
1845 1846 1847 1848 1849 1850 1851 | 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 | - + - + | writeImplemented = true; if (writeFlags == -1) @throw [OFSetOptionFailedException exceptionWithObject: self errNo: errno]; |
︙ | |||
1912 1913 1914 1915 1916 1917 1918 | 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 | - + | [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = NULL; _readBufferLength = 0; [self freeMemory: _writeBuffer]; _writeBuffer = NULL; _writeBufferLength = 0; |