Ios 当反复调用NSUrlConnection进行连接时,NSUrlConnection有时无法命中主机服务器

Ios 当反复调用NSUrlConnection进行连接时,NSUrlConnection有时无法命中主机服务器,ios,objective-c,xcode,cocos2d-x,nsurlconnection,Ios,Objective C,Xcode,Cocos2d X,Nsurlconnection,这就是我如何使用NSUrlConnection - (void) serverHttpRequest:(NSString*)data forUrl:(NSString*)Url withTag:(NSString*)tag httpType:(NSString *)type forThisTime:(int)tryTime

这就是我如何使用
NSUrlConnection

- (void) serverHttpRequest:(NSString*)data
                        forUrl:(NSString*)Url
                       withTag:(NSString*)tag
                      httpType:(NSString *)type
                   forThisTime:(int)tryTime
           withTimeOutInterval:(float)interval
    {


        NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@", Url]];

        NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url
                                                                  cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                              timeoutInterval:interval];

        [theRequest setHTTPMethod:type];
        [theRequest setValue:@"application/x-www-form-urlencoded;charset=utf-8" forHTTPHeaderField:@"Content-Type"];


        NSString *postData = data;

        NSString *length = [NSString stringWithFormat:@"%d", [postData length]];
        [theRequest setValue:length forHTTPHeaderField:@"Content-Length"];
        [theRequest setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];

        self.theConnection = [NSURLConnection connectionWithRequest:theRequest delegate:self];
        [self.theConnection start];

    }
但当它重复调用时,几乎50%的时间都无法命中服务器。为什么会发生这种情况。呼叫频率为每秒。 并非所有请求的url都相同,客户端需要使用
httppost
请求从java服务器上的多个servlet获取数据。可能是服务器端配置错误


可能问题不在客户端,因为当我在两个不同的设备上运行相同的代码时,它们都同时收到错误响应。这些设备还通过代理服务器连接到互联网。错误代码是HTTP 503。我知道当服务器过载或拒绝响应时会显示此错误,但它在接收其他客户端的请求时工作正常。我已经实现了basic
javaservlet
,并使用
JDBC
驱动程序将其连接到
MySql
数据库。如果有人能告诉我应该如何在服务器或客户端上进行配置更改。谢谢

我所知道的确定服务器返回503响应原因的唯一方法是检查服务器的日志,看看哪里出了问题。或者检查代理服务器的日志。

我所知道的确定服务器返回503响应原因的唯一方法是检查服务器的日志并查看出了什么问题。或者检查代理服务器的日志。

可能与我编辑的问题重复。另外,问题不在客户端。可能与我编辑的问题重复。问题也不在客户端。