ICE 3.4.2
[php5-ice-freebsdport.git] / vb / demo / Ice / bidir / Client.vb
blobd9a016f8ab390eed88bad00e647b6d828528a9bc
1 ' **********************************************************************
3 ' Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 ' This copy of Ice is licensed to you under the terms described in the
6 ' ICE_LICENSE file included in this distribution.
8 ' **********************************************************************
10 Imports BidirDemo
12 Module BidirC
13 Class Client
14 Inherits Ice.Application
16 Public Overloads Overrides Function run(ByVal args() As String) As Integer
17 If args.Length > 0 Then
18 Console.Error.WriteLine(appName() & ": too many arguments")
19 Return 1
20 End If
22 Dim server As CallbackSenderPrx = CallbackSenderPrxHelper.checkedCast(communicator().propertyToProxy("Callback.Client.CallbackServer"))
23 If server Is Nothing Then
24 System.Console.Error.WriteLine("invalid proxy")
25 Return 1
26 End If
28 Dim adapter As Ice.ObjectAdapter = communicator().createObjectAdapter("")
29 Dim ident As Ice.Identity = New Ice.Identity
30 ident.name = System.Guid.NewGuid().ToString()
31 ident.category = ""
32 adapter.add(New CallbackReceiverI, ident)
33 adapter.activate()
34 server.ice_getConnection().setAdapter(adapter)
35 server.addClient(ident)
36 communicator().waitForShutdown()
38 Return 0
39 End Function
41 End Class
43 Public Sub Main(ByVal args() As String)
44 Dim app As Client = New Client
45 Dim status As Integer = app.main(args, "config.client")
46 System.Environment.Exit(status)
47 End Sub
49 End Module