Android Socket Permission Denied Error

If the LastErrorText contains a line such as this:

socketError: Permission denied

It means you need to add permissions for Internet communications in your manifest. It should be placed outside of the application tag, such as:

<manifest>
    <application>
     .
     .
     .
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

IOS Error: Broken pipe … Failed to send ClientHello

The following error can be caused by a firewall blocking the iPAD/iPhone wifi connection:

...
      connect successful (1)
      clientHelloMajorMinorVersion: 3.1
      buildClientHello:
        majorVersion: 3
        minorVersion: 1
        numRandomBytes: 32
        sessionIdSize: 0
        numCipherSuites: 10
        numCompressionMethods: 1
      socketErrno: 32
      socketError: Broken pipe
      Error sending on socket
      send_size: 58
      Failed to send TLS message.
      Failed to send ClientHello
      Client handshake failed.
    Failed to connect to POP3 server.
    Failed to ensure transaction state.
...

.NET Assembly Incorrect Format Error

"Could not load file or assembly 'ChilkatDotNet2, Version=9.3.0.0, Culture=neutral,
PublicKeyToken=eb5fc1fc52ef09bd' or one of its dependencies.
 An attempt was made to load a program with an incorrect format."

The “incorrect format” error is a 32-bit vs. 64-bit mismatch.  It means the application is trying to load a 64-bit .NET assembly into a 32-bit process,  or the reverse (a 32-bit assembly into a 64-bit process).

Possible solutions are:

1) Target your app for x86 instead of “Any CPU”.  If you do this, then your application will run as a 32-bit process regardless of the machine architecture and you may always use the 32-bit Chilkat assembly.

2) If you really need to target “Any CPU”, then make sure to deploy the 32-bit Chilkat assembly w/ your app on 32-bit systems, and deploy the 64-bit Chilkat assembly to 64-bit systems.

3) If your app is running within ASP.NET or a Windows Service and you’re not quite sure whether it’s 32-bit or 64-bit, then install the 32-bit Chilkat assembly in the 32-bit GAC (Global Assembly Cache), and also install the 64-bit Chilkat assembly into the 64-bit GAC.  The .NET runtime will automatically look in the correct GAC and will find the correct assembly.

Common IOS undefined symbols error

Link Error:

Undefined symbols for architecture i386:

“operator new(unsigned long)”, referenced from:
-[CkoMailMan init] in libchilkatIos.a(CkoMailMan.o)
“operator delete(void*)”, referenced from:
-[CkoMailMan init] in libchilkatIos.a(CkoMailMan.o)

Solution:
The Chilkat internals are written in C++. Therefore, your Objective-C application will need to link against the C++ runtime libraries. The easiest way to do it is to include an empty source file with the file extension “cpp” in your app target.

SFTP Permission Denied w/ OpenFile Method

Question:

We are trying to upload a file to SFTP using private key. We are able to connect and retrieve folder listing. But when we try to upload to one of the folder on the SFTP we get the “Permission denied” error message.

The message is as below.

ChilkatLog:
  OpenFile:
    DllDate: Feb 15 2010
    UnlockPrefix: ****
    Username: joe
    Component: .NET 2.0
    SshVersion: SSH-1.99-OpenSSH_3.8p1
    SftpVersion: 3
    filename: .\Upload\myFiles\test.xml
    access: writeOnly
    createDisposition: createNew
    v3Flags: 0x2a
    Sent FXP_OPEN
    StatusResponse:
      Request: FXP_OPEN
      StatusCode: 3
      StatusMessage: Permission denied
    SshLog:
SFTP> Sending SSH_FXP_OPEN
TRAN> CHANNEL_DATA
TRAN* NumBytes: 44
TRAN< CHANNEL_DATA
SFTP< Received SSH_FXP_STATUS

Answer:

The content of the LastErrorText property (as shown above) provides good information that allows me to suggest some things to try:

  1. I can see by the “DllDate” that the version being used is older.  I would highly recommend updating to the latest version to ensure you’re getting the best information in LastErrorText.  The information in LastErrorText is always being refined and improvedd as Chilkat does user-support day-to-day.
  2. The createDisposition passed to OpenFile in this case is “createNew”.  If the file already exists, then the OpenFile will fail.  It’s possible that the server will indicate the failure as a “Permission denied” error.  Instead, use “createTruncate” for the createDisposition argument.
  3. I see that backslashes are used in the remote file path.  Try using forward slashes instead.
  4. To fully understand the absolute file path of the destination file on the SSH/SFTP server, call RealPath to ask the server to convert a relative path to an absolute path.  Maybe the SSH/SFTP user account’s home directory is something different than expected.

VB6 Error — “TYPE MISMATCH (ERROR CODE 13)” w/ IMAP Search method

This happens if the Chilkat ActiveX objects are dragged and dropped onto your formvia the “Project–>Components” menu. Instead, add a reference to the objects via the “Project–>References” menu.

Instances of the object should be created dynamically. For example:

Dim imap as ChilkatImap
Set imap = New ChilkatImap

WSAECONNREFUSED No connection could be made because the target machine actively refused it.

One possible cause of this socket connect error is when an Anti-Virus program blocks the connection. This can happen if the AV program is blocking the outbound port. If some programs can connect to a given remote host:port, but your application cannot, then check your Anti-Virus program to see if exceptions were made for specific programs, but not for your application’s EXE.

VC++ Link problem: fatal error C1047, “Chilkat*.lib’ was created with an older compiler than other objects; rebuild old objects and libraries”

Regarding the following VC++ link problem:

“fatal error C1047: The object or library file 'c:\Chilkat\libs\x64\ChilkatRel_x64.lib' 
was created with an older compiler than other objects; rebuild old objects and libraries”

This can be resolved by building without the /LTCG flag turned on. Unfortunately, it is not possible to use the /LTCG flag if you are using the Chilkat libraries. Compiling and linking your C++ application without using the /LTCG flag should resolve the problem.

IMAP Login: BAD Command received in Invalid state.

This error can happen if you connect to an IMAP server without SSL/TLS (i.e. at port 143) but the server does not allow unsecure sessions.  Oddly enough, the Microsoft Exchange IMAP4 server will accept the connection, but will fail any login attempt with this error.  Here is a sample SessionLog:

Connecting to IMAP server at xxxx.com:143
> ----IMAP RESPONSE----
> * OK The Microsoft Exchange IMAP4 service is ready.
> ----IMAP REQUEST----
> aaab LOGIN "mylogin"
> ----IMAP RESPONSE----
> aaab BAD Command received in Invalid state.

The solution is to use port 993 w/ SSL/TLS. Do this by setting the Chilkat.Imap.Port property = 993, and the Chilkat.Imap.Ssl property = True prior to connecting.

Error 0x8002801D when Instantiating Chilkat HTTP ActiveX

This error indicates that there is a
problem with the registry information for the ActiveX DLL. The registry
entry may be missing or contain incorrect information, or the user may
not have permission to read the registry entry.

In ASP, the error message may look like this: 
Server object error ‘ASP 0177 : 8002801d’

In applications, you may see an error message such as this: 
OLE error code 0x8002801d: Library not registered

First try unregistering and re-registering the DLL.  On the computer or server where the ChilkatHttp.dll is located, open a DOS prompt and “cd” to the directory where the DLL is located.  Then unregister by typing:

regsvr32 -u ChilkatHttp.dll

Next, register the ActiveX DLL by typing:

regsvr32 ChilkatHttp.dll

If it fails, then create a .bat file in the same directory as the DLL.  Type the “regsvr32 ChilkatHttp.dll” command into the .bat script.  Right-click on the .bat and select “Run as Administrator”.  This should register the DLL.   Check to see if the problem is resolved in your ASP page or application.

Finally, if the problem remains, it could be a permissions problem. (I have no idea why the permissions
might be different..) In any case, please see the information at this Microsoft
support knowledge-base article. It provides details about changing the
registry entry permissions so that your ASP code has permission to read
the registry entries:

http://support.microsoft.com/kb/274038