Visual Basic: Connect to the Server

To connect to the server from your Visual Basic program:

  1. Set the server and port to connect to.
    Call RpcbPropSet(intRpcbHandle, "Server", "BROKERSERVER")
    Call RpcbPropSet(intRpcbHandle, "ListenerPort", "9200")
    
  2. Set the Connected property to true; this attempts a connection to the server.
    Call RpcbPropSet(intRpcbHandle, "Connected", "1")
  3. Check if you are still connected. If so, you can continue (your connection was made). If not, you should quit or branch accordingly.
    RPCBPropGet(intRpcbHandle, "Connected", strResult)
  4. Attempt to create context for your application's "B"-type option. If you can't create context, you should quit or branch accordingly. If RpcbCreateContext returns True, then you are ready to call all RPCs registered to your application's "B"-type option.
    intResult = RpcbCreateContext(intRpcbHandle, "MY APPLICATION")