Connect(String,Int32) Method
- Last UpdatedApr 08, 2026
- 1 minute read
Connects to the local PubSub engine using the specified parameters.
public void Connect(
string AppName,
int BufferSize
)
public:
void Connect(
String^ AppName,
int BufferSize
)
Parameters
- AppName
- The name of the application.
- BufferSize
- The number of messages the PubSub engine should buffer for this application connection before declaring it too slow.
This method will use the parameters to initiate a new PubSub connection, but it will not use the global one. This connection is only used by this PubSubConnection object and is not shared. The object is still thread safe and can be used by multiple threads if they share this PubSubConnection object. This command does nothing if this object is already connected, even if it is connected using the global PubSub connection. In this case, Disconnect must be called.
The use of this method to obtain a private PubSub connection is discouraged in favor of using
PubSubConnection PS = new PubSubConnection();
// Connect with the name myApplication
// and a buffer size of 20000
PS.Connect("myApplication", 20000);
PubSubConnection PS = new PubSubConnection();
// Connect with the name myApplication
// and a buffer size of 20000
PS.Connect("myApplication", 20000);
Reference
PubSubConnection Class
PubSubConnection Members
Overload List
PubSubConnectionFactory.OpenConnection