Connect Method

Connects to the remote host.

Syntax

ANSI (Cross Platform)
int Connect(const char* lpszHost, int iPort);

Unicode (Windows)
INT Connect(LPCWSTR lpszHost, INT iPort);
- (void)connect:(NSString*)host :(int)port;
#define MID_STOMP_CONNECT 7

IPWORKSMQ_EXTERNAL int IPWORKSMQ_CALL IPWorksMQ_STOMP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method connects to the remote host. Calling this method is equivalent to setting the RemoteHost property to Host, setting RemotePort to Port, and then setting the Connected property to True.

By default the class will connect in plaintext. To enable SSL set SSLEnabled to True.

When connecting to a STOMP server, the class sends information from the following properties, if populated:

In addition to the above properties, the following configuration settings can be set before connecting (though in most cases this is not necessary):

  • SupportedVersions: Controls which STOMP versions the class advertises support for.
  • VirtualHost: Controls the virtual host to connect to. If left empty (default), the value from RemoteHost is used.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 C++ Edition - Version 20.0 [Build 8155]