Red5 Java客户端连接

发布于 2025-01-02 04:41:03 字数 1743 浏览 1 评论 0原文

我正在尝试为red5应用程序实现一个java客户端,它实现了一个简单的视频聊天。我为该应用程序实现了一个 Flash 客户端,并且使用 Flash 客户端一切正常。 对于java客户端,我尝试使用RTMPClient类建立与服务器的连接。在服务器端没有发生任何事情,客户端产生以下输出。

java版本:1.6 red5版本:1.0.0

连接red5服务器的代码:

RTMPClient c = new RTMPClient();
c.connect("server", 5080, "app");

输出java客户端:

[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Session created
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Creating connection, class: org.red5.server.net.rtmp.RTMPMinaConnection
[NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaConnection - RTMPMinaConnection created
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Connection id set 1
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Connection added to the map
[NioProcessor-2] DEBUG o.r.server.net.rtmp.RTMPConnection - Set state: RTMP [state=connect, client-mode=true, debug=false, encrypted=false, lastReadChannel=0, lastWriteChannel=0, readHeaders={}, writeHeaders={}, readPacketHeaders={}, readPackets={}, writePackets={}, writeTimestamps={}, liveTimestamps={}, readChunkSize=128, writeChunkSize=128, encoding=AMF0]
[NioProcessor-2] DEBUG o.red5.server.net.rtmp.RTMPHandshake - Handshake ctor
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Session opened
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Handshake - client phase 1
[NioProcessor-2] DEBUG o.red5.server.net.rtmp.RTMPHandshake - generateClientRequest1
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - messageSent
[NioProcessor-2] DEBUG o.r.server.net.rtmp.BaseRTMPHandler - Message sent 

提前谢谢

I am trying to implement a java client for a red5 application, which implements a simple video chat. I implemented a flash client for the application and with the flash client everything works fine.
For the java client I tried to use the RTMPClient class to establish a connection to the server. On the server side nothing happened and the client produced the following output.

java version: 1.6
red5 version: 1.0.0

code to connect to red5 server:

RTMPClient c = new RTMPClient();
c.connect("server", 5080, "app");

output java client:

[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Session created
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Creating connection, class: org.red5.server.net.rtmp.RTMPMinaConnection
[NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaConnection - RTMPMinaConnection created
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Connection id set 1
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPClientConnManager - Connection added to the map
[NioProcessor-2] DEBUG o.r.server.net.rtmp.RTMPConnection - Set state: RTMP [state=connect, client-mode=true, debug=false, encrypted=false, lastReadChannel=0, lastWriteChannel=0, readHeaders={}, writeHeaders={}, readPacketHeaders={}, readPackets={}, writePackets={}, writeTimestamps={}, liveTimestamps={}, readChunkSize=128, writeChunkSize=128, encoding=AMF0]
[NioProcessor-2] DEBUG o.red5.server.net.rtmp.RTMPHandshake - Handshake ctor
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Session opened
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - Handshake - client phase 1
[NioProcessor-2] DEBUG o.red5.server.net.rtmp.RTMPHandshake - generateClientRequest1
[NioProcessor-2] DEBUG o.r.s.net.rtmp.RTMPMinaIoHandler - messageSent
[NioProcessor-2] DEBUG o.r.server.net.rtmp.BaseRTMPHandler - Message sent 

Thx in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你与昨日 2025-01-09 04:41:03

我认为默认情况下你不应该连接到端口 5080 而应连接到端口 1935

I think you should not connect to port 5080 but to port 1935 by default

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文