• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 7.1.0.193
GDNETiOS.h
Go to the documentation of this file.
1 /*
2  * (c) 2017 BlackBerry Limited. All rights reserved.
3  *
4  */
5 
6 #pragma once
7 
8 #import <Foundation/Foundation.h>
9 #import "GDURLLoadingSystem.h"
10 #import "GDPortability.h"
11 #import "GDNET.h"
12 
20 typedef NS_ENUM(NSInteger, GDSocketErrorType)
21 {
28 
35 
42 };
43 
45 
53 
54 @required
65 - (void)onOpen:(id) socket;
66 
67 @required
80 - (void)onRead:(id) socket;
81 
82 @required
95 - (void)onClose:(id) socket;
96 
97 @required
107 - (void)onErr:(int)error inSocket:(id) socket;
108 
109 @end
110 
111 
122 @interface GDDirectByteBuffer : NSObject {
123  @private
124  void* m_dbbInternal;
125 }
126 
134 - (instancetype)init;
135 
148 - (void)write:(const char*)data;
149 
161 - (void)writeData:(NSData*)data;
162 
175 - (void)write:(const char*)data withLength:(int)length;
176 
181 - (int)bytesUnread;
182 
214 - (int)read:(char*)data toMaxLength:(int)maxLength;
215 
238 - (GD_NSNULLABLE NSMutableString*)unreadDataAsString;
239 
261 - (GD_NSNULLABLE NSMutableData*)unreadData;
262 
263 @end
264 
473 @interface GDSocket : NSObject {
475  __weak id <GDSocketDelegate> GD_NSNULLABLE_POINTER delegate;
476  @private
477  void* m_socketInternal;
480 }
481 
499 - (instancetype)init:(const char*)url onPort:(int)port andUseSSL:(BOOL)ssl;
500 
530 - (BOOL)disableHostVerification;
531 
564 - (BOOL)disablePeerVerification;
565 
573 - (void)connect;
574 
581 - (void)write;
582 
590 - (void)disconnect;
591 
602 @property (GD_NSNULLABLE_PROP nonatomic, weak) id<GDSocketDelegate> delegate;
603 
612 @property (GD_NSNULLABLE_PROP nonatomic, strong) GDDirectByteBuffer* writeStream;
613 
626 @property (GD_NSNULLABLE_PROP nonatomic, strong) GDDirectByteBuffer* readStream;
627 
628 @end
629 
630 /* \cond DOXYGEN_IGNORE */
631 #if __has_extension(attribute_deprecated_with_message)
632 # define DEPRECATE_GDHTTPREQUESTDELEGATE __attribute__((deprecated("GDHttpRequestDelegate interface has been deprecated")))
633 #else
634 # define DEPRECATE_GDHTTPREQUESTDELEGATE __attribute__((deprecated))
635 #endif
636 /* \endcond */
637 
647 DEPRECATE_GDHTTPREQUESTDELEGATE
649 
650 @required
669 - (void)onStatusChange:(id) httpRequest DEPRECATE_GDHTTPREQUESTDELEGATE;
670 
671 @end
672 
688 typedef NS_ENUM(NSInteger, GDHttpRequest_state_t)
689 {
711 } DEPRECATE_GDHTTPREQUESTDELEGATE;
712 
713 // See: http://clang.llvm.org/docs/LanguageExtensions.html
714 /* \cond DOXYGEN_IGNORE */
715 #ifndef __has_extension
716 #define __has_extension(x) 0 // Compatibility with non-clang compilers.
717 #endif
718 /* \endcond */
719 
720 /* \cond DOXYGEN_IGNORE */
721 #if __has_extension(attribute_deprecated_with_message)
722 # define DEPRECATE_CLEARCOOKIES __attribute__((deprecated("No longer supported")))
723 #else
724 # define DEPRECATE_CLEARCOOKIES __attribute__((deprecated))
725 #endif
726 #if __has_extension(attribute_deprecated_with_message)
727 # define DEPRECATE_GDHTTPREQUEST __attribute__((deprecated("GDHttpRequest interface has been deprecated")))
728 #else
729 # define DEPRECATE_GDHTTPREQUEST __attribute__((deprecated))
730 #endif
731 /* \endcond */
1078 DEPRECATE_GDHTTPREQUEST
1079 @interface GDHttpRequest : NSObject {
1080  __weak id <GDHttpRequestDelegate> GD_NSNULLABLE_POINTER delegate;
1081  @private
1082  void* m_httpRequestInternal;
1083 }
1084 
1098 - (instancetype)init DEPRECATE_GDHTTPREQUEST;
1099 
1162 - (BOOL) open:(const char*)method withUrl:(const char*)url withAsync:(BOOL) isAsync withUser:(GD_NSNULLABLE const char*)user withPass:(GD_NSNULLABLE const char*)password withAuth:(GD_NSNULLABLE const char*)auth DEPRECATE_GDHTTPREQUEST;
1163 
1175 - (BOOL) open:(const char*)method withUrl:(const char*)url withUser:(GD_NSNULLABLE const char*)user withPass:(GD_NSNULLABLE const char*)password withAuth:(GD_NSNULLABLE const char*)auth DEPRECATE_GDHTTPREQUEST;
1176 
1193 - (BOOL) open:(const char*)method withUrl:(const char*)url withAsync:(BOOL)isAsync DEPRECATE_GDHTTPREQUEST;
1194 
1211 - (BOOL) open:(const char*)method withUrl:(const char*)url DEPRECATE_GDHTTPREQUEST;
1212 
1256 - (BOOL) disableHostVerification DEPRECATE_GDHTTPREQUEST;
1257 
1305 - (BOOL) disablePeerVerification DEPRECATE_GDHTTPREQUEST;
1306 
1335 - (BOOL) disableFollowLocation DEPRECATE_GDHTTPREQUEST;
1336 
1361 - (BOOL) disableCookieHandling DEPRECATE_GDHTTPREQUEST;
1362 
1390 - (void) clearCookies:(BOOL) includePersistentStore DEPRECATE_CLEARCOOKIES;
1391 
1441 - (BOOL) enableHttpProxy:(const char*)host withPort:(int)port withUser:(const char*)user withPass:(const char*)password withAuth:(const char*)auth DEPRECATE_GDHTTPREQUEST;
1442 
1456 - (BOOL) enableHttpProxy:(const char*)host withPort:(int)port DEPRECATE_GDHTTPREQUEST;
1457 
1478 - (BOOL) disableHttpProxy DEPRECATE_GDHTTPREQUEST;
1479 
1510 - (BOOL) setRequestHeader:(const char*)header withValue:(const char*)value DEPRECATE_GDHTTPREQUEST;
1511 
1536 - (void) setPostValue:(const char*)value forKey:(const char*)key DEPRECATE_GDHTTPREQUEST;
1537 
1557 - (void) clearPostValues DEPRECATE_GDHTTPREQUEST;
1558 
1618 - (BOOL) send:(GD_NSNULLABLE const char*)data withLength:(unsigned int)len withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1619 
1632 - (BOOL) send:(GD_NSNULLABLE const char*)data withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1633 
1634 
1646 - (BOOL) send:(GD_NSNULLABLE const char*)data DEPRECATE_GDHTTPREQUEST;
1647 
1662 - (BOOL) send DEPRECATE_GDHTTPREQUEST;
1663 
1675 - (BOOL) sendData:(GD_NSNULLABLE NSData*)data withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1676 
1688 - (BOOL) sendData:(GD_NSNULLABLE NSData*)data DEPRECATE_GDHTTPREQUEST;
1689 
1723 - (BOOL) sendWithFile:(NSString*)pathAndFileName withTimeout:(NSTimeInterval)timeoutSeconds DEPRECATE_GDHTTPREQUEST;
1724 
1737 - (BOOL) sendWithFile:(NSString*)pathAndFileName DEPRECATE_GDHTTPREQUEST;
1738 
1756 - (GDHttpRequest_state_t) getState DEPRECATE_GDHTTPREQUEST;
1757 
1784 - (GD_NSNULLABLE const char*) getResponseHeader:(const char*)header DEPRECATE_GDHTTPREQUEST;
1785 
1809 - (GD_NSNULLABLE const char*) getAllResponseHeaders DEPRECATE_GDHTTPREQUEST;
1810 
1873 - (int) getStatus DEPRECATE_GDHTTPREQUEST;
1874 
1918 - (GD_NSNULLABLE const char*) getStatusText DEPRECATE_GDHTTPREQUEST;
1919 
1953 - (GD_NSNULLABLE GDDirectByteBuffer*) getReceiveBuffer DEPRECATE_GDHTTPREQUEST;
1954 
1991 - (BOOL) close DEPRECATE_GDHTTPREQUEST;
1992 
2019 - (BOOL) abort DEPRECATE_GDHTTPREQUEST;
2020 
2043 @property (nonatomic, assign) BOOL enablePipelining DEPRECATE_GDHTTPREQUEST;
2044 
2062 @property (GD_NSNULLABLE_PROP nonatomic, weak) id<GDHttpRequestDelegate> delegate DEPRECATE_GDHTTPREQUEST;
2063 
2064 @end
2065 
GDHttpRequestDelegate-p
Delegate for handling GDHttpRequest state transitions (deprecated).
Definition: GDNETiOS.h:648
GD_NSNULLABLE
#define GD_NSNULLABLE
Definition: GDPortability.h:71
GDSocketErrorServiceTimeOut
@ GDSocketErrorServiceTimeOut
Socket operation timed out.
Definition: GDNETiOS.h:41
GD_NSNULLABLE_PROP
#define GD_NSNULLABLE_PROP
Definition: GDPortability.h:70
GDSocketErrorType
GDSocketErrorType
Constants for GDSocket errors.
Definition: GDNETiOS.h:20
GDHttpRequest_HEADERS_RECEIVED
@ GDHttpRequest_HEADERS_RECEIVED
The request has been sent, and response headers have been received (deprecated).
Definition: GDNETiOS.h:702
GDSocketErrorNone
@ GDSocketErrorNone
No error.
Definition: GDNETiOS.h:27
GDSocketErrorNetworkUnvailable
@ GDSocketErrorNetworkUnvailable
Destination network not available.
Definition: GDNETiOS.h:34
GDHttpRequest_state_t
GDHttpRequest_state_t
Constants for HTTP Request ready states (deprecated).
Definition: GDNETiOS.h:688
GDHttpRequest_DONE
@ GDHttpRequest_DONE
All data has been received, or a permanent error has been encountered (deprecated).
Definition: GDNETiOS.h:710
GDURLLoadingSystem.h
GDNET.h
GDSocket::writeStream
GDDirectByteBuffer * writeStream
Outbound buffer.
Definition: GDNETiOS.h:478
GDHttpRequest::delegate
__weak id< GDHttpRequestDelegate > delegate
Definition: GDNETiOS.h:1080
GDHttpRequest_SENT
@ GDHttpRequest_SENT
The request has been sent (deprecated).
Definition: GDNETiOS.h:698
GDHttpRequest_UNSENT
@ GDHttpRequest_UNSENT
Prior to the request being opened (deprecated).
Definition: GDNETiOS.h:692
GD_NSNULLABLE_POINTER
#define GD_NSNULLABLE_POINTER
Definition: GDPortability.h:77
GDSocket::readStream
GDDirectByteBuffer * readStream
Inbound buffer.
Definition: GDNETiOS.h:479
GDSocketDelegate-p
Delegate for handling GDSocket state transitions and received data.
Definition: GDNETiOS.h:52
GDSocket
TCP socket, supporting SSL/TLS and communication across the firewall.
Definition: GDNETiOS.h:473
GD_NS_ASSUME_NONNULL_END
#define GD_NS_ASSUME_NONNULL_END
Definition: GDPortability.h:89
GDHttpRequest_LOADING
@ GDHttpRequest_LOADING
Headers and some data have been received in response to the request (deprecated).
Definition: GDNETiOS.h:706
GDHttpRequest_OPENED
@ GDHttpRequest_OPENED
The request is ready to have headers added, and be sent (deprecated).
Definition: GDNETiOS.h:695
GDHttpRequest
Standards-based HTTP request, also supporting HTTPS and communication across the firewall (deprecated...
Definition: GDNETiOS.h:1079
GDDirectByteBuffer
Buffer for accessing GDSocket and GDHttpRequest data.
Definition: GDNETiOS.h:122
GD_NS_ASSUME_NONNULL_BEGIN
#define GD_NS_ASSUME_NONNULL_BEGIN
Definition: GDPortability.h:88
GDPortability.h