blob: 01d1edf33459c3221cf4fdbf3b576f3950cf8543 (
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
|
' **********************************************************************
'
' Copyright (c) 2003-2007 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.
'
' **********************************************************************
Module AsyncS
Class Server
Inherits Ice.Application
Public Overloads Overrides Function run(ByVal args() As String) As Integer
callbackOnInterrupt()
Dim adapter As Ice.ObjectAdapter = communicator().createObjectAdapter("Hello")
_workQueue = New WorkQueue
adapter.add(New HelloI(_workQueue), communicator().stringToIdentity("hello"))
_workQueue.Start()
adapter.activate()
communicator().waitForShutdown()
Return 0
End Function
Public Overloads Overrides Sub interruptCallback(ByVal sig As Integer)
_workQueue.destroy()
_workQueue.Join()
Try
communicator().destroy()
Catch ex As Ice.LocalException
Console.Error.WriteLine(ex)
Catch ex As System.Exception
Console.Error.WriteLine(ex)
End Try
End Sub
Private _workQueue As WorkQueue
End Class
Public Sub Main(ByVal args() As String)
Dim app As Server = New Server
Dim status As Integer = app.Main(args, "config.server")
System.Environment.Exit(status)
End Sub
End Module
|