@@ -43,8 +43,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
43
43
44
44
@interface GCDAsyncSocket : NSObject
45
45
{
46
- UInt16 flags;
47
- UInt16 config;
46
+ uint16_t flags;
47
+ uint16_t config;
48
48
49
49
id delegate;
50
50
dispatch_queue_t delegateQueue;
@@ -191,7 +191,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
191
191
*
192
192
* The socket will listen on all available interfaces (e.g. wifi, ethernet, etc)
193
193
**/
194
- - (BOOL )acceptOnPort : (UInt16 )port error : (NSError **)errPtr ;
194
+ - (BOOL )acceptOnPort : (uint16_t )port error : (NSError **)errPtr ;
195
195
196
196
/* *
197
197
* This method is the same as acceptOnPort:error: with the
@@ -209,7 +209,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
209
209
*
210
210
* To accept connections on any interface pass nil, or simply use the acceptOnPort:error: method.
211
211
**/
212
- - (BOOL )acceptOnInterface : (NSString *)interface port : (UInt16 )port error : (NSError **)errPtr ;
212
+ - (BOOL )acceptOnInterface : (NSString *)interface port : (uint16_t )port error : (NSError **)errPtr ;
213
213
214
214
#pragma mark Connecting
215
215
@@ -219,15 +219,15 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
219
219
* This method invokes connectToHost:onPort:viaInterface:withTimeout:error:
220
220
* and uses the default interface, and no timeout.
221
221
**/
222
- - (BOOL )connectToHost : (NSString *)host onPort : (UInt16 )port error : (NSError **)errPtr ;
222
+ - (BOOL )connectToHost : (NSString *)host onPort : (uint16_t )port error : (NSError **)errPtr ;
223
223
224
224
/* *
225
225
* Connects to the given host and port with an optional timeout.
226
226
*
227
227
* This method invokes connectToHost:onPort:viaInterface:withTimeout:error: and uses the default interface.
228
228
**/
229
229
- (BOOL )connectToHost : (NSString *)host
230
- onPort : (UInt16 )port
230
+ onPort : (uint16_t )port
231
231
withTimeout : (NSTimeInterval )timeout
232
232
error : (NSError **)errPtr ;
233
233
@@ -261,7 +261,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
261
261
* This feature is here for networking professionals using very advanced techniques.
262
262
**/
263
263
- (BOOL )connectToHost : (NSString *)host
264
- onPort : (UInt16 )port
264
+ onPort : (uint16_t )port
265
265
viaInterface : (NSString *)interface
266
266
withTimeout : (NSTimeInterval )timeout
267
267
error : (NSError **)errPtr ;
@@ -376,10 +376,10 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
376
376
* The host will be an IP address.
377
377
**/
378
378
- (NSString *)connectedHost ;
379
- - (UInt16 )connectedPort ;
379
+ - (uint16_t )connectedPort ;
380
380
381
381
- (NSString *)localHost ;
382
- - (UInt16 )localPort ;
382
+ - (uint16_t )localPort ;
383
383
384
384
/* *
385
385
* Returns the local or remote address to which this socket is connected,
@@ -728,7 +728,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
728
728
*
729
729
* Example usage:
730
730
*
731
- * - (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16 )port
731
+ * - (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t )port
732
732
* {
733
733
* [asyncSocket performBlock:^{
734
734
* [asyncSocket enableBackgroundingOnSocket];
@@ -788,8 +788,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
788
788
* Extracting host and port information from raw address data.
789
789
**/
790
790
+ (NSString *)hostFromAddress : (NSData *)address ;
791
- + (UInt16 )portFromAddress : (NSData *)address ;
792
- + (BOOL )getHost : (NSString **)hostPtr port : (UInt16 *)portPtr fromAddress : (NSData *)address ;
791
+ + (uint16_t )portFromAddress : (NSData *)address ;
792
+ + (BOOL )getHost : (NSString **)hostPtr port : (uint16_t *)portPtr fromAddress : (NSData *)address ;
793
793
794
794
/* *
795
795
* A few common line separators, for use with the readDataToData:... methods.
@@ -844,7 +844,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
844
844
* Called when a socket connects and is ready for reading and writing.
845
845
* The host parameter will be an IP address, not a DNS name.
846
846
**/
847
- - (void )socket : (GCDAsyncSocket *)sock didConnectToHost : (NSString *)host port : (UInt16 )port ;
847
+ - (void )socket : (GCDAsyncSocket *)sock didConnectToHost : (NSString *)host port : (uint16_t )port ;
848
848
849
849
/* *
850
850
* Called when a socket has completed reading the requested data into memory.
0 commit comments