hostile-takeover/game/sdl/ios/iphonehttpservice.h
Nathan Fulton 93d484864e NSURLConnection -> NSURLSession for SDL-iOS
Code for this commit is based off of the network code in game/iphone
2016-08-31 22:43:35 -04:00

35 lines
777 B
Objective-C

#ifndef __IPHONEHTTPSERVICE_H__
#define __IPHONEHTTPSERVICE_H__
#include "game/sdl/ios/iphonehttprequest.h"
#include "inc/basictypes.h"
#include "game/httpservice.h"
#include <map>
typedef std::map<NSURLSessionDataTask *, wi::IPhoneHttpRequest *> TaskMap;
@interface SessionDelegate : NSObject<NSURLSessionDataDelegate> {
NSURLSession *session_;
TaskMap taskmap_;
}
@end
namespace wi {
class IPhoneHttpService : public HttpService {
public:
IPhoneHttpService();
// HttpService methods
virtual HttpRequest *NewRequest(HttpResponseHandler *phandler);
virtual void SubmitRequest(HttpRequest *preq);
virtual void ReleaseRequest(HttpRequest *preq);
private:
SessionDelegate *delegate_;
};
} // namespace wi
#endif // __IPHONEHTTPSERVICE_H__