Skip to content

Commit

Permalink
Minor fixes for Swift demos
Browse files Browse the repository at this point in the history
The current.adapter data member is never nil in the context of the demos
  • Loading branch information
bentoi committed Oct 10, 2019
1 parent 2e94e2d commit b444aab
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions swift/Glacier2/callback/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ setbuf(__stdoutp, nil)
class CallbackI: Callback {
func initiateCallback(proxy: CallbackReceiverPrx?, current: Current) {
do {
let proxyName = current.adapter?.getCommunicator().proxyToString(proxy)
print("initiating callback to: \(String(describing: proxyName)))")
let proxyName = current.adapter!.getCommunicator().proxyToString(proxy)
print("initiating callback to: \(proxyName)")
try proxy?.callback()
} catch {
print("Error \(error)")
Expand All @@ -21,7 +21,7 @@ class CallbackI: Callback {

func shutdown(current: Current) {
print("shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}

Expand Down
2 changes: 1 addition & 1 deletion swift/Ice/async/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HelloI: Hello {
serialQueue.async {
print("Shutting down...")
self.done = true
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion swift/Ice/asyncInvocation/Sources/Server/CalculatorI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class CalculatorI: Calculator {
}

func shutdown(current: Ice.Current) {
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}
2 changes: 1 addition & 1 deletion swift/Ice/context/Sources/Server/ContextI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class ContextI: Context {

func shutdown(current: Ice.Current) {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}
2 changes: 1 addition & 1 deletion swift/Ice/hello/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HelloI: Hello {

func shutdown(current: Ice.Current) throws {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}

Expand Down
2 changes: 1 addition & 1 deletion swift/Ice/interceptor/Sources/Server/ThermostatI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class ThermostatI: Thermostat {

func shutdown(current: Ice.Current) {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}
2 changes: 1 addition & 1 deletion swift/Ice/invoke/Sources/Server/PrinterI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PrinterI: Ice.Blobject {
outStream.endEncapsulation()
ret = (ok: false, outParams: outStream.finished())
case "shutdown":
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
ret = (ok: true, outParams: Data())
default:
throw Ice.OperationNotExistException(id: current.id, facet: current.facet, operation: current.operation)
Expand Down
2 changes: 1 addition & 1 deletion swift/Ice/optional/Sources/Server/ContactDBI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ class ContactDBI: ContactDB {

func shutdown(current: Ice.Current) {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}
2 changes: 1 addition & 1 deletion swift/Ice/throughput/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ThroughputI: Throughput {
}

func shutdown(current: Current) throws {
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}

Expand Down
2 changes: 1 addition & 1 deletion swift/IceDiscovery/hello/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HelloI: Hello {

func shutdown(current: Ice.Current) throws {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}

Expand Down
2 changes: 1 addition & 1 deletion swift/IceDiscovery/replication/Sources/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HelloI: Hello {

func shutdown(current: Ice.Current) throws {
print("Shutting down...")
current.adapter?.getCommunicator().shutdown()
current.adapter!.getCommunicator().shutdown()
}
}

Expand Down

0 comments on commit b444aab

Please sign in to comment.