commit 20/10/2025
This commit is contained in:
@@ -29,7 +29,7 @@ import java.util.function.Consumer
|
||||
* @param outputFilePath The path to the file where the received data will be written.
|
||||
* @param senderIP The IP address of the sender from which to accept packets.
|
||||
*/
|
||||
class UDPReceiverToFile(listeningAddress: String, listeningPort: Int, val samplingrate: Int=44100, val channel: Int=1, val outputFilePath: String, val senderIP: String) {
|
||||
class UDPReceiverToFile(listeningAddress: String, listeningPort: Int, val samplingrate: Int=44100, val channel: Int=1, val outputFilePath: String, val senderIP: String) {
|
||||
|
||||
private var socket: DatagramSocket? = null
|
||||
private val bass : Bass = Bass.Instance
|
||||
|
||||
@@ -31,7 +31,8 @@ class UDPSenderFromFile(val fileName: String, val bytesPerPackage: Int=1024, tar
|
||||
if (handle!=0){
|
||||
// test buka file berhasil, tutup lagi
|
||||
bass.BASS_StreamFree(handle)
|
||||
if (targetPort>0 && targetPort<65535){
|
||||
//if (targetPort>0 && targetPort<65535){
|
||||
if (targetPort in 0..65535){
|
||||
if (targetIP.isNotEmpty()){
|
||||
var validIPs = true
|
||||
for(ip in targetIP){
|
||||
|
||||
Reference in New Issue
Block a user