blob: e19020a1d357839d9b5b977e22e904c525b5009d (
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
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
import Ice
class TestIntfI: TestIntf {
func ping(reply: PingReplyPrx?, current _: Current) throws {
do {
try reply!.reply()
} catch {
precondition(false)
}
}
func sendByteSeq(seq _: ByteSeq, reply: PingReplyPrx?, current _: Current) throws {
do {
try reply!.reply()
} catch {
precondition(false)
}
}
func pingBiDir(reply: Identity, current: Current) throws {
do {
//
// Ensure sending too much data doesn't cause the UDP connection
// to be closed.
//
do {
let seq = Ice.ByteSeq(repeating: 0, count: 32 * 1024)
let prx = try uncheckedCast(prx: current.con!.createProxy(reply), type: TestIntfPrx.self)
try prx.sendByteSeq(seq: seq, reply: nil)
} catch is Ice.DatagramLimitException {
// Expected.
}
try uncheckedCast(prx: current.con!.createProxy(reply),
type: PingReplyPrx.self).reply()
} catch {
precondition(false)
}
}
func shutdown(current: Current) throws {
current.adapter!.getCommunicator().shutdown()
}
}
|