Gets or sets the HSMS connection status. If Connect property is set to true where Server property is false (client), SavoyHsms control will attempt to establish connection. If connection has not been established, Connect property will be set to false.
If Connect property is set to true where Server property is true (server), SavoyHsms control will attempt to open server port and start listening to prepare for future incoming connection. At this time connection has not been established until client connected server. Therefore, even no connection was made, Connect property would be True, when server port was opened.
If user sets False to Connect property, existing connection will be disconnected. User doesn’t have to worry about connection to make sure it is disconnected when application is closing. SavoyHsms control will take care disconnection automatically. When Server property was set to True and Connected property is set to False, all existing connections with clients will be disconnected.
Syntax
|
BOOL GetConnect()
void SetConnect(BOOL)
|
Return Value
Example
|
.IPAddress = "hsms_server"
.PortNumber = 5000
.MyPortNumber = 0
.Server = False
.Connect = True ' Open
If Not .Connect then
MsgBox "Cannot connect to server!"
End If
|
|
m_ctrl.SetIPAddress("hsms_server");
m_ctrl.SetPortNumber(5000);
m_ctrl.SetLocalPortNumber(0);
m_ctrl.SetServer(false);
m_ctrl.SetConnect(true); // Open
if(!m_ctrl.GetConnect())
MessageBox("Cannot connect to server!");
|
Remarks
If Connect property on server side was set to False, connection would be disconnected. Therefore, Connect property on client side would also be set to False.
See Also
|