Closed alexthemitchell closed 4 years ago
It seemes works for me.
https://github.com/shogo4405/HaishinKit.swift/blob/master/Examples/iOS/LiveViewController.swift#L153
2020-15-03 22:36:58.024 [Warn] [com.haishinkit.HaishinKit] [RTMPConnection.swift:380] on(status:) >
2020-15-03 22:36:58.032 [Info] [com.haishinkit.HaishinKit] [AudioConverter.swift:86] inSourceFormat > nil
2020-15-03 22:36:58.032 [Info] [com.haishinkit.Exsample.iOS] [LiveViewController.swift:155] rtmpStatusHandler(_:) > Event{type: Name(rawValue: "rtmpStatus"),bubbles: false,data: Optional(["description": Optional(""), "code": Optional("NetConnection.Connect.Closed"), "level": Optional("status")]),target: Optional(HaishinKit.RTMPConnection)}
2020-03-15 22:36:59.048072+0900 Example iOS[4538:391553] [] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-03-15 22:36:59.048153+0900 Example iOS[4538:391553] TCP Conn 0x283a521c0 Failed : error 0:50 [50]
2020-15-03 22:36:59.049 [Info] [com.haishinkit.Exsample.iOS] [LiveViewController.swift:155] rtmpStatusHandler(_:) > Event{type: Name(rawValue: "rtmpStatus"),bubbles: false,data: Optional(["description": Optional(""), "code": Optional("NetConnection.Connect.Failed"), "level": Optional("error")]),target: Optional(HaishinKit.RTMPConnection)}
Simulator iPhone XR
It's a simulators problem?
@shogo4405 Thanks, you're right. It's a simulator problem; it emits the event as expected on a device.
This resolves my immediate issue, so feel free to close unless you can solve the problem in the simulator :)
Should RTMPConnection.Code.connectClosed.rawValue
be called in rtmpStatusHandler
when it does rtmpConnection.close()
?
I didn't receive the event connectClosed
.
It seemes that application can't get disconnect event from NSOutputStream, NSInputStream. I can't fix it. So I will close this issue.
Describe the bug Our RTMP status listening function is not getting a notification when we disconnect WiFi. After reviewing https://github.com/shogo4405/HaishinKit.swift/issues/489, we do not know why our listener is not receiving the
.connectClosed
event.To Reproduce Steps to reproduce the behavior:
self.rtmpStatusHandler
as.rtmpStatus
listener:rtmpStatusHandler
:NetStream.Publish.Start
andNetConnection.Connect.Success
events logged in console:rtmpStatusHandler
Expected behavior
rtmpStatusHandler
is called with.connectClosed
or.connectNetworkChange
event; in this case, printing logs with event info.Smartphone (please complete the following information):