Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 69b4193

Browse files
committed
Update ConnectionTest.java
1 parent 87e1f1c commit 69b4193

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# VBAN-API [![Build Status](https://travis-ci.com/burdoto/VBAN-API.svg?branch=master)](https://travis-ci.com/burdoto/VBAN-API) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api)
1+
# VBAN-API [![Build Status](https://travis-ci.com/burdoto/VBAN-API.svg?branch=master)](https://travis-ci.com/burdoto/VBAN-API) [![Maven Central Release](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api) [![Development Release](https://jitpack.io/v/burdoto/VBAN-API.svg)](https://jitpack.io/#burdoto/VBAN-API)
22
API for the known VB-Audio VBAN Network interface
33

44

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
package de.kaleidox.test.vban;
22

33
import java.io.IOException;
4-
import java.net.InetAddress;
54
import java.nio.charset.StandardCharsets;
65

76
import de.kaleidox.vban.VBAN;
87

9-
public class ConnectionTest {
10-
public static void main(String[] args) throws IOException {
11-
VBAN<String> vban = VBAN.openTextStream(InetAddress.getLocalHost(), VBAN.DEFAULT_PORT);
12-
13-
vban.writeFlush("bus(0).mute=1".getBytes(StandardCharsets.UTF_8));
8+
import static java.net.InetAddress.getLocalHost;
9+
import static de.kaleidox.vban.VBAN.DEFAULT_PORT;
1410

15-
vban.sendData("bus(1).mute=0");
11+
public class ConnectionTest {
12+
public static void main(String[] args) {
13+
try (VBAN<String> vban = VBAN.openTextStream(getLocalHost(), DEFAULT_PORT)) {
14+
int i = 0;
15+
while (i++ < 10) {
16+
vban.writeFlush("bus(0).mute=1".getBytes(StandardCharsets.UTF_8));
17+
Thread.sleep(500);
18+
vban.sendData("bus(0).mute=0");
19+
Thread.sleep(500);
20+
}
21+
} catch (InterruptedException | IOException e) {
22+
e.printStackTrace();
23+
}
1624
}
1725
}

0 commit comments

Comments
 (0)