cocos2d-x  3.0alpha1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HttpClient Class Reference

Singleton that handles asynchrounous http requests Once the request completed, a callback will issued in main thread when it provided during make request. More...

#include <HttpClient.h>

Inheritance diagram for HttpClient:
Object

Public Member Functions

void enableCookies (const char *cookieFile)
 Enable cookie support. More...
 
void send (HttpRequest *request)
 Add a get request to task queue. More...
 
void setTimeoutForConnect (int value)
 Change the connect timeout. More...
 
int getTimeoutForConnect ()
 Get connect timeout. More...
 
void setTimeoutForRead (int value)
 Change the download timeout. More...
 
int getTimeoutForRead ()
 Get download timeout. More...
 
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

static HttpClientgetInstance ()
 Return the shared instance. More...
 
local getInstance ()
 Return the shared instance. More...
 
static void destroyInstance ()
 Relase the shared instance. More...
 
local destroyInstance ()
 Relase the shared instance. More...
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 

Detailed Description

Singleton that handles asynchrounous http requests Once the request completed, a callback will issued in main thread when it provided during make request.

Member Function Documentation

static void destroyInstance ( )
static

Relase the shared instance.

var destroyInstance ( )
static

Relase the shared instance.

local destroyInstance ( )
static

Relase the shared instance.

void enableCookies ( const char *  cookieFile)

Enable cookie support.

var enableCookies ( var  cookieFile)

Enable cookie support.

local enableCookies ( local  cookieFile)

Enable cookie support.

static HttpClient* getInstance ( )
static

Return the shared instance.

var getInstance ( )
static

Return the shared instance.

local getInstance ( )
static

Return the shared instance.

int getTimeoutForConnect ( )
inline

Get connect timeout.

Returns
int
var getTimeoutForConnect ( )
inline

Get connect timeout.

Returns
int
local getTimeoutForConnect ( )
inline

Get connect timeout.

Returns
int
int getTimeoutForRead ( )
inline

Get download timeout.

Returns
int
var getTimeoutForRead ( )
inline

Get download timeout.

Returns
int
local getTimeoutForRead ( )
inline

Get download timeout.

Returns
int
void send ( HttpRequest request)

Add a get request to task queue.

Parameters
requesta HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "send" here.
var send ( var  request)

Add a get request to task queue.

Parameters
requesta HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "send" here.
local send ( local  request)

Add a get request to task queue.

Parameters
requesta HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "send" here.
void setTimeoutForConnect ( int  value)
inline

Change the connect timeout.

Parameters
valueThe desired timeout.
var setTimeoutForConnect ( var  value)
inline

Change the connect timeout.

Parameters
valueThe desired timeout.
local setTimeoutForConnect ( local  value)
inline

Change the connect timeout.

Parameters
valueThe desired timeout.
void setTimeoutForRead ( int  value)
inline

Change the download timeout.

Parameters
value
var setTimeoutForRead ( var  value)
inline

Change the download timeout.

Parameters
value
local setTimeoutForRead ( local  value)
inline

Change the download timeout.

Parameters
value

The documentation for this class was generated from the following file: