NSURL Connection Error - objective-c

I am using the Wikitude plugin on iOS for AR and I am getting the following errors. Sometimes it will run then other times it will just keep loading. When it does run it gives the errors but everything functions perfect. The code that loads the view is the following:
self.architectWorldNavigation = [self.architectView loadArchitectWorldFromURL:[[NSBundle mainBundle] URLForResource:#"index" withExtension:#"html" subdirectory:#"files"]];
I am not sure what could be causing this, sometimes disconnecting from wifi works.
Cheers,
Curtis
2018-02-12 13:00:39.326356+0000 UAReloaded[5763:2125598]
NSURLConnection finished with error - code -1100 2018-02-12
13:00:40.743844+0000 UAReloaded[5763:2125632] TIC TCP Conn Failed
[1:0x1d01654c0]: 1:61 Err(61) 2018-02-12 13:00:40.743939+0000
UAReloaded[5763:2125632] Task
.<0> HTTP load failed (error
code: -1004 [1:61]) 2018-02-12 13:00:40.744102+0000
UAReloaded[5763:2125594] NSURLConnection finished with error - code
-1004

Related

While Download Works But Post Request Not (Chilkat)

I am facing a very wired issue, and passed so many hours to find the issue but without any luck :(
i have setup a web server on my mobile (android)..
and trying to use that using my vb application
where i simple call Download method on the very sample url (same ip/port), it works and save the response body as downloaded file.
but when i try to send post command it is not working, it gives error "Connection rejected"
here is the code to download:
objDHTTP.Download("http://192.168.1.101:8000/fileAdmin.php", strAppDir & "\wtf-response.txt")
here is the code when i tried to use same url and port for post request:
objDRequest.Path = "/fileAdmin.php"
objDRequest.AddParam("fileAction", "Upload")
objDRequest.AddParam("fileName", "DB.sql")
objDRequest.AddFileForUpload("adminFile", strAppDir & "\c.dll")
objDResponse = objDHTTP.SynchronousRequest(strServerIP, 8000, False, objDRequest)
but it does not works and throws above error
here is the success response (for download method):
<ChilkatLog>
<Download>
<DllDate>Dec 21 2018</DllDate>
<ChilkatVersion>9.5.0.76</ChilkatVersion>
<Architecture>Little Endian; 32-bit</Architecture>
<Language>.NET 4.0</Language>
<VerboseLogging>0</VerboseLogging>
<url>http://192.168.1.101:8000/fileAdmin.php</url>
<toLocalPath>G:\wtf-sucess.txt</toLocalPath>
<currentWorkingDir>G:\</currentWorkingDir>
<a_httpDownload>
<httpDownloadFile>
<localFilePath>G:\wtf-sucess.txt</localFilePath>
<localFileAlreadyExists>1</localFileAlreadyExists>
<quickHttpRequest>
<httpVerb>GET</httpVerb>
<url>http://192.168.1.101:8000/fileAdmin.php</url>
<openHttpConnection>
<info>Opening connection directly to HTTP server.</info>
<httpHostname>192.168.1.101</httpHostname>
<httpPort>8000</httpPort>
<tls>False</tls>
<info>HTTP connection succeeded.</info>
</openHttpConnection>
<buildQuickRequest>
<genStartLine>
<startLine>GET /fileAdmin.php HTTP/1.1</startLine>
</genStartLine>
<addCookies>
<info>Not auto-adding cookies.</info>
<sendCookies>1</sendCookies>
<cookieDir></cookieDir>
</addCookies>
</buildQuickRequest>
<sendRequestHeader>
<sendHeaderElapsedMs>0</sendHeaderElapsedMs>
</sendRequestHeader>
<statusCode>200</statusCode>
<statusText>OK</statusText>
<checkCloseConnection>
<info>Response includes connection:close header (or proxy-connection:close header)</info>
</checkCloseConnection>
</quickHttpRequest>
<outputLocalFileSize>26</outputLocalFileSize>
<numOutputBytesWritten>26</numOutputBytesWritten>
</httpDownloadFile>
</a_httpDownload>
<totalElapsedMs>47</totalElapsedMs>
<ContentLength>0</ContentLength>
<info>Success.</info>
</Download>
</ChilkatLog>
And here is the error/fail response (for post request):
<ChilkatLog>
<SynchronousRequest>
<DllDate>Dec 21 2018</DllDate>
<ChilkatVersion>9.5.0.76</ChilkatVersion>
<Architecture>Little Endian; 32-bit</Architecture>
<Language>.NET 4.0</Language>
<VerboseLogging>0</VerboseLogging>
<domain>191.168.1.101</domain>
<port>8000</port>
<ssl>0</ssl>
<httpRequest>
<httpVersion>1.1</httpVersion>
<verb>POST</verb>
<path>/fileAdmin.php</path>
<contentType>multipart/form-data</contentType>
<charset>windows-1252</charset>
<sendCharset>0</sendCharset>
<mimeHeader></mimeHeader>
<requestParams>
<requestItem>
<name>fileAction</name>
<value>Upload</value>
</requestItem>
<requestItem>
<name>fileName</name>
<value>DB.sql</value>
</requestItem>
<requestItem>
<name>adminFile</name>
<fileOnDisk>G:\c.dll</fileOnDisk>
<numValueBytes>8697</numValueBytes>
</requestItem>
</requestParams>
</httpRequest>
<fullRequest>
<a_synchronousRequest>
<generateRequestHeader>
<httpRequestGenStartLine>
<genStartLine>
<startLine>POST /fileAdmin.php HTTP/1.1</startLine>
</genStartLine>
</httpRequestGenStartLine>
<addCookies>
<info>Not auto-adding cookies.</info>
<sendCookies>1</sendCookies>
<cookieDir></cookieDir>
</addCookies>
<genMultipartFormData>
<requestParam>
<name>fileAction</name>
</requestParam>
<requestParam>
<name>fileName</name>
</requestParam>
<requestParam>
<name>adminFile</name>
<filename>G:\c.dll</filename>
</requestParam>
</genMultipartFormData>
</generateRequestHeader>
<fullHttpRequest>
<domain>191.168.1.101</domain>
<port>8000</port>
<ssl>0</ssl>
<openHttpConnection>
<info>Opening connection directly to HTTP server.</info>
<httpHostname>191.168.1.101</httpHostname>
<httpPort>8000</httpPort>
<tls>False</tls>
<socket2Connect>
<connect2>
<connectSocket>
<connect_ipv6_or_ipv4>
<info>Connection attempt failed.</info>
<maxWaitTimeMs>10000</maxWaitTimeMs>
<totalMsWaitedSoFar>2100</totalMsWaitedSoFar>
</connect_ipv6_or_ipv4>
<connect_ipv6_or_ipv4>
<info>Connection attempt failed.</info>
<maxWaitTimeMs>10000</maxWaitTimeMs>
<totalMsWaitedSoFar>2150</totalMsWaitedSoFar>
</connect_ipv6_or_ipv4>
</connectSocket>
<ConnectFailReason>Connection rejected</ConnectFailReason>
<error>A few possible causes for a connection being rejected are:</error>
<error>- A firewall (software or hardware), such as Windows Firewall, is blocking the connection .</error>
<error>- Nothing is listening at the remote host:port</error>
</connect2>
</socket2Connect>
</openHttpConnection>
</fullHttpRequest>
<success>0</success>
</a_synchronousRequest>
<success>0</success>
</fullRequest>
<totalTime>Elapsed time: 4390 millisec</totalTime>
<error>Failed.</error>
</SynchronousRequest>
</ChilkatLog>
can any one tell me what could be the reason for this?
thanks in advance
best regards
The likely reasons are present in the LastErrorText:
<ConnectFailReason>Connection rejected</ConnectFailReason>
<error>A few possible causes for a connection being rejected are:</error>
<error>- A firewall (software or hardware), such as Windows Firewall, is blocking the connection .</error>
<error>- Nothing is listening at the remote host:port</error>
My guess is that the Windows Firewall is blocking the outbound POST.
This example shows the errors one would get for various TCP socket connection problems: https://www.example-code.com/vbnet/socket_connect_fail.asp

Talend (7.0.1) - Cannot modify mapred.job.name at runtime

I am having some trouble running a simple tHiveCreateTable job in Talend OS for Big Data (Print of the job where I am getting this error).
The Hive connection is fine and the job worked until Ranger was activated in the cluster.
After ranger, I started getting the following log:
[statistics] connecting to socket on port 3345
[statistics] connected
Error while processing statement: Cannot modify mapred.job.name at runtime. It is not in list of params that are allowed to be modified at runtime
[statistics] disconnected
This error occurs either using Tez or MapReduce for the job, throwing an exception in the following line of the automatically generated code:
// For MapReduce Mode
stmt_tHiveCreateTable_1.execute("set mapred.job.name=" + queryIdentifier);
Do you know any solution or workarround for this?
Thanks in advance
It is possible to disable changing mapreduce.job.name and hive.query.name at runtime by Talend7 jobs.
Edit the file
{talend_install_dir}/plugins/org.talend.designer.components.localprovider_7.1.1.20181026_1147/components/templates/Hive/SetQueryName.javajet
and comment out lines 6 and 11 like that:
// stmt_<%=cid %>.execute("set mapred.job.name=" + queryIdentifier_<%=cid %>);
// stmt_<%=cid %>.execute("set hive.query.name=" + queryIdentifier_<%=cid %>);
It solved this issue for me.

__tcp_connection_write_eof_block_invoke Write close callback received error: [89] Operation canceled

I am getting this when uploading to server in this API I am uploading audio file and text data and if I remove audio it is working fine and I am getting this error in iOS 10. In iOS below 10 it's working fine all data is getting uploaded.
Error: The request timed out. 2016-11-11 10:17:26.263019 Smart Child Info[1407:423623] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [89] Operation canceled
Seems that your request timed out, try (assuming you are using NSMutableURLRequest and you want a timeout of 120 seconds):
request.timeoutInterval = 120;

using ObjectAL with spritekit causes SKAction sounds not to be found?

I'm trying to use both ObjectAL and native SKAction in my spritekit project.
I've got it working, but when i run this code,
OALSimpleAudio.sharedInstance().playBg("shipengine.wav", loop:true)
it gives me an error saying 'Resource powershotbeep.wav can not be loaded' this is a file I use with SKAction somewhere else in the project. any idea why this would be happening?
if i stop loading those actions, then my shipengine sound will play just fine
i've tried this with objective-c as well.. i get this error
2014-09-06 13:18:23.790 testsound[59331:4033724] OAL Error: +[ALWrapper openDevice:]: Could not open device (null)
2014-09-06 13:18:23.791 testsound[59331:4033724] OAL Error: -[ALDevice initWithDeviceSpecifier:]: : Failed to create OpenAL device (null)
2014-09-06 13:18:23.791 testsound[59331:4033724] OAL Error: +[ALWrapper closeDevice:]: Invalid Enum (error code 0x0000a003)
2014-09-06 13:18:23.791 testsound[59331:4033724] OAL Warning: -[OALAudioSession onAudioError:]: Received audio error notification, but last reset was 0.001220 seconds ago. Doing nothing.
2014-09-06 13:18:23.791 testsound[59331:4033724] OAL Error: -[OALSimpleAudio initWithSources:]: : Could not create OpenAL device

How to have multiple subclasses of MKNetworkKit?

I am currently using MKNetworkKit to cache the download of several images from a restful server. I have another restful service I ping to get supplemental information about the images. Whichever server I ping first works, but when pinging the second server I get the following error:
[The operation couldn’t be completed. (NSURLErrorDomain error 404.)]
2012-08-12 19:51:12.340 [51853:11603]
Error: Error Domain=NSURLErrorDomain Code=404 "The operation couldn’t be completed. (NSURLErrorDomain error 404.)" UserInfo=0x73c5490 {Server=Apache-Coyote/1.1, Content-Length=47, Content-Type=text/html;charset=ISO-8859-1, Connection=keep-alive, Date=Sun, 12 Aug 2012 23:51:11 GMT}
2012-08-12 19:51:12.341 [MKNetworkOperation operationFailedWithError:] [Line 1280] State: 0
MKNetworkKit is pinging the first server in attempt to get data from the second server's URL. I think I may need to create another reachability object? Any idea what I'm doing wrong? Or where I can find some example implementation of one project with multiple subclasses?
Edit
I implement both engines the following way:
#implementation FirstEngine
FirstEngine* _sharedEngine;
+(FirstEngine*)sharedEngine
{
if(_sharedEngine==nil)
{
_sharedEngine = [[FirstEngine alloc] initWithHostName:#"***.**.**.**" customHeaderFields:nil];
}
return _sharedEngine;
}
and invoke them this way:
$[[FirstEngine sharedEngine] bodyForPath:url verb:verb body:params onCompletion:^(NSDictionary* body)
{}....
or
$[[SecondEngine sharedEngine] bodyForPath:url verb:verb body:params onCompletion:^(NSDictionary* body)
{}....
You should create a MKNetworkEngine object in your AppDelegate for "every" server you talk to.
self.imageCacheEngine = [[MKNetworkEngine alloc] initWithHostName:#"images.myserver.com"];
and
self.apiEngine = [[MKNetworkEngine alloc] initWithHostName:#"api.myserver.com"];
Enqueue image requests to the imageCacheEngine and api requests to your apiEngine.