blob: ac29c4956b0c01a01fd8619a723a3fa2367c4cb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
' **********************************************************************
'
' Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
'
' This copy of Ice is licensed to you under the terms described in the
' ICE_LICENSE file included in this distribution.
'
' **********************************************************************
Imports System
Imports Demo
Public Class PrinterI
Inherits PrinterDisp_
Public Overloads Overrides Sub printString(ByVal s As String, ByVal current As Ice.Current)
Console.WriteLine(s)
End Sub
End Class
Module Server
Public Sub Main(ByVal args() As String)
Dim status As Integer = 0
Dim ic As Ice.Communicator = Nothing
Try
ic = Ice.Util.initialize(args)
Dim adapter As Ice.ObjectAdapter = ic.createObjectAdapterWithEndpoints("SimplePrinterAdapter", "default -h localhost -p 10000")
Dim obj As Ice.Object = New PrinterI
adapter.add(obj, ic.stringToIdentity("SimplePrinter"))
adapter.activate()
ic.waitForShutdown()
Catch e As Exception
Console.Error.WriteLine(e)
status = 1
End Try
If Not ic Is Nothing Then
' Clean up
'
Try
ic.destroy()
Catch e As Exception
Console.Error.WriteLine(e)
status = 1
End Try
End If
Environment.Exit(status)
End Sub
End module
|