• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.2.0.83
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 "GDNET.h"
11 
19 typedef NS_ENUM(NSInteger, GDSocketErrorType)
20 {
27 
34 
41 };
42 
43 NS_ASSUME_NONNULL_BEGIN
44 
52 
53 @required
64 - (void)onOpen:(id) socket;
65 
66 @required
79 - (void)onRead:(id) socket;
80 
81 @required
94 - (void)onClose:(id) socket;
95 
96 @required
106 - (void)onErr:(int)error inSocket:(id) socket;
107 
108 @end
109 
110 
121 @interface GDDirectByteBuffer : NSObject {
122  @private
123  void* m_dbbInternal;
124 }
125 
133 - (instancetype)init;
134 
147 - (void)write:(const char*)data;
148 
160 - (void)writeData:(NSData*)data;
161 
174 - (void)write:(const char*)data withLength:(int)length;
175 
180 - (int)bytesUnread;
181 
213 - (int)read:(char*)data toMaxLength:(int)maxLength;
214 
237 - (nullable NSMutableString*)unreadDataAsString;
238 
260 - (nullable NSMutableData*)unreadData;
261 
262 @end
263 
472 @interface GDSocket : NSObject {
474  __weak id <GDSocketDelegate> _Nullable delegate;
475  @private
476  void* m_socketInternal;
479 }
480 
498 - (instancetype)init:(const char*)url onPort:(int)port andUseSSL:(BOOL)ssl;
499 
529 - (BOOL)disableHostVerification;
530 
563 - (BOOL)disablePeerVerification;
564 
572 - (void)connect;
573 
580 - (void)write;
581 
589 - (void)disconnect;
590 
601 @property (nullable, nonatomic, weak) id<GDSocketDelegate> delegate;
602 
611 @property (nullable, nonatomic, strong) GDDirectByteBuffer* writeStream;
612 
625 @property (nullable, nonatomic, strong) GDDirectByteBuffer* readStream;
626 
627 @end
628 
629 /* \cond DOXYGEN_IGNORE */
630 #if __has_extension(attribute_deprecated_with_message)
631 # define DEPRECATE_GDHTTPREQUESTDELEGATE __attribute__((deprecated("GDHttpRequestDelegate interface has been deprecated")))
632 #else
633 # define DEPRECATE_GDHTTPREQUESTDELEGATE __attribute__((deprecated))
634 #endif
635 /* \endcond */
636 
646 DEPRECATE_GDHTTPREQUESTDELEGATE
648 
649 @required
668 - (void)onStatusChange:(id) httpRequest DEPRECATE_GDHTTPREQUESTDELEGATE;
669 
670 @end
671 
687 typedef NS_ENUM(NSInteger, GDHttpRequest_state_t)
688 {
710 } DEPRECATE_GDHTTPREQUESTDELEGATE;
711 
712 // See: http://clang.llvm.org/docs/LanguageExtensions.html
713 /* \cond DOXYGEN_IGNORE */
714 #ifndef __has_extension
715 #define __has_extension(x) 0 // Compatibility with non-clang compilers.
716 #endif
717 /* \endcond */
718 
719 /* \cond DOXYGEN_IGNORE */
720 #if __has_extension(attribute_deprecated_with_message)
721 # define DEPRECATE_CLEARCOOKIES __attribute__((deprecated("No longer supported")))
722 #else
723 # define DEPRECATE_CLEARCOOKIES __attribute__((deprecated))
724 #endif
725 #if __has_extension(attribute_deprecated_with_message)
726 # define DEPRECATE_GDHTTPREQUEST __attribute__((deprecated("GDHttpRequest interface has been deprecated")))
727 #else
728 # define DEPRECATE_GDHTTPREQUEST __attribute__((deprecated))
729 #endif
730 /* \endcond */
1077 DEPRECATE_GDHTTPREQUEST
1078 @interface GDHttpRequest : NSObject {
1079  __weak id <GDHttpRequestDelegate> _Nullable delegate;
1080  @private
1081  void* m_httpRequestInternal;
1082 }
1083 
1097 - (instancetype)init DEPRECATE_GDHTTPREQUEST;
1098 
1161 - (BOOL) open:(const char*)method withUrl:(const char*)url withAsync:(BOOL) isAsync withUser:(nullable const char*)user withPass:(nullable const char*)password withAuth:(nullable const char*)auth DEPRECATE_GDHTTPREQUEST;
1162 
1174 - (BOOL) open:(const char*)method withUrl:(const char*)url withUser:(nullable const char*)user withPass:(nullable const char*)password withAuth:(nullable const char*)auth DEPRECATE_GDHTTPREQUEST;
1175 
1192 - (BOOL) open:(const char*)method withUrl:(const char*)url withAsync:(BOOL)isAsync DEPRECATE_GDHTTPREQUEST;
1193 
1210 - (BOOL) open:(const char*)method withUrl:(const char*)url DEPRECATE_GDHTTPREQUEST;
1211 
1255 - (BOOL) disableHostVerification DEPRECATE_GDHTTPREQUEST;
1256 
1304 - (BOOL) disablePeerVerification DEPRECATE_GDHTTPREQUEST;
1305 
1334 - (BOOL) disableFollowLocation DEPRECATE_GDHTTPREQUEST;
1335 
1360 - (BOOL) disableCookieHandling DEPRECATE_GDHTTPREQUEST;
1361 
1389 - (void) clearCookies:(BOOL) includePersistentStore DEPRECATE_CLEARCOOKIES;
1390 
1440 - (BOOL) enableHttpProxy:(const char*)host withPort:(int)port withUser:(const char*)user withPass:(const char*)password withAuth:(const char*)auth DEPRECATE_GDHTTPREQUEST;
1441 
1455 - (BOOL) enableHttpProxy:(const char*)host withPort:(int)port DEPRECATE_GDHTTPREQUEST;
1456 
1477 - (BOOL) disableHttpProxy DEPRECATE_GDHTTPREQUEST;
1478 
1509 - (BOOL) setRequestHeader:(const char*)header withValue:(const char*)value DEPRECATE_GDHTTPREQUEST;
1510 
1535 - (void) setPostValue:(const char*)value forKey:(const char*)key DEPRECATE_GDHTTPREQUEST;
1536 
1556 - (void) clearPostValues DEPRECATE_GDHTTPREQUEST;
1557 
1617 - (BOOL) send:(nullable const char*)data withLength:(unsigned int)len withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1618 
1631 - (BOOL) send:(nullable const char*)data withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1632 
1633 
1645 - (BOOL) send:(nullable const char*)data DEPRECATE_GDHTTPREQUEST;
1646 
1661 - (BOOL) send DEPRECATE_GDHTTPREQUEST;
1662 
1674 - (BOOL) sendData:(nullable NSData*)data withTimeout:(int)timeout_s DEPRECATE_GDHTTPREQUEST;
1675 
1687 - (BOOL) sendData:(nullable NSData*)data DEPRECATE_GDHTTPREQUEST;
1688 
1722 - (BOOL) sendWithFile:(NSString*)pathAndFileName withTimeout:(NSTimeInterval)timeoutSeconds DEPRECATE_GDHTTPREQUEST;
1723 
1736 - (BOOL) sendWithFile:(NSString*)pathAndFileName DEPRECATE_GDHTTPREQUEST;
1737 
1755 - (GDHttpRequest_state_t) getState DEPRECATE_GDHTTPREQUEST;
1756 
1783 - (nullable const char*) getResponseHeader:(const char*)header DEPRECATE_GDHTTPREQUEST;
1784 
1808 - (nullable const char*) getAllResponseHeaders DEPRECATE_GDHTTPREQUEST;
1809 
1872 - (int) getStatus DEPRECATE_GDHTTPREQUEST;
1873 
1917 - (nullable const char*) getStatusText DEPRECATE_GDHTTPREQUEST;
1918 
1952 - (nullable GDDirectByteBuffer*) getReceiveBuffer DEPRECATE_GDHTTPREQUEST;
1953 
1990 - (BOOL) close DEPRECATE_GDHTTPREQUEST;
1991 
2018 - (BOOL) abort DEPRECATE_GDHTTPREQUEST;
2019 
2042 @property (nonatomic, assign) BOOL enablePipelining DEPRECATE_GDHTTPREQUEST;
2043 
2061 @property (nullable, nonatomic, weak) id<GDHttpRequestDelegate> delegate DEPRECATE_GDHTTPREQUEST;
2062 
2063 @end
2064 
2065 NS_ASSUME_NONNULL_END
GDHttpRequestDelegate-p
Delegate for handling GDHttpRequest state transitions (deprecated).
Definition: GDNETiOS.h:647
GDSocketErrorServiceTimeOut
@ GDSocketErrorServiceTimeOut
Socket operation timed out.
Definition: GDNETiOS.h:40
GDSocketErrorType
GDSocketErrorType
Constants for GDSocket errors.
Definition: GDNETiOS.h:19
GDHttpRequest_HEADERS_RECEIVED
@ GDHttpRequest_HEADERS_RECEIVED
The request has been sent, and response headers have been received (deprecated).
Definition: GDNETiOS.h:701
GDSocketErrorNone
@ GDSocketErrorNone
No error.
Definition: GDNETiOS.h:26
GDSocketErrorNetworkUnvailable
@ GDSocketErrorNetworkUnvailable
Destination network not available.
Definition: GDNETiOS.h:33
GDHttpRequest_state_t
GDHttpRequest_state_t
Constants for HTTP Request ready states (deprecated).
Definition: GDNETiOS.h:687
GDHttpRequest_DONE
@ GDHttpRequest_DONE
All data has been received, or a permanent error has been encountered (deprecated).
Definition: GDNETiOS.h:709
GDURLLoadingSystem.h
GDNET.h
GDSocket::writeStream
GDDirectByteBuffer * writeStream
Outbound buffer.
Definition: GDNETiOS.h:477
GDHttpRequest_SENT
@ GDHttpRequest_SENT
The request has been sent (deprecated).
Definition: GDNETiOS.h:697
GDHttpRequest_UNSENT
@ GDHttpRequest_UNSENT
Prior to the request being opened (deprecated).
Definition: GDNETiOS.h:691
GDSocket::readStream
GDDirectByteBuffer * readStream
Inbound buffer.
Definition: GDNETiOS.h:478
GDSocketDelegate-p
Delegate for handling GDSocket state transitions and received data.
Definition: GDNETiOS.h:51
GDSocket
TCP socket, supporting SSL/TLS and communication across the firewall.
Definition: GDNETiOS.h:472
GDHttpRequest::delegate
__weak id< GDHttpRequestDelegate > _Nullable delegate
Definition: GDNETiOS.h:1079
GDHttpRequest_LOADING
@ GDHttpRequest_LOADING
Headers and some data have been received in response to the request (deprecated).
Definition: GDNETiOS.h:705
GDHttpRequest_OPENED
@ GDHttpRequest_OPENED
The request is ready to have headers added, and be sent (deprecated).
Definition: GDNETiOS.h:694
GDHttpRequest
Standards-based HTTP request, also supporting HTTPS and communication across the firewall (deprecated...
Definition: GDNETiOS.h:1078
GDDirectByteBuffer
Buffer for accessing GDSocket and GDHttpRequest data.
Definition: GDNETiOS.h:121