当前位置:网站首页>106. simple chat room 9: use socket to transfer audio

106. simple chat room 9: use socket to transfer audio

2022-06-25 08:48:00 Jasonakeke

Title Description

Topic realization : When using network programming , Need to pass through Socket Deliver audio .

Their thinking

Create a server class :ServerSocketFrame, Inherit JFrame class

Write a getServer() Method , Instantiation Socket object , Enable 9527 When the port of the service .

Create an input stream object , Used to receive client information .

Let me define one more getClientInfo() Method , Used to receive audio files sent by the client .

Add an event to the text box : Realize sending weighing information to the client .

Create a client class :ClientSocketFrame, Inherit JFrame class .

Write a connect() Method , Instantiation Socket object , Connect to the local service 9527 Port services .

Let me define one more getClientInfo() Method , Used to receive audio files sent by the server .

Technical focus :

DataInputStream Class read() Methods and DataOutputStream Class from DataOutput Class inheritance write() Method to read and write audio files , Different from the previous question, this question uses “ preservation ” Dialog box , Save the received audio file to the host of the receiver .

Code details

原网站

版权声明
本文为[Jasonakeke]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250743457589.html