forked from sta/websocket-sharp
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (31 loc) · 808 Bytes
/
Program.cs
File metadata and controls
35 lines (31 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Threading;
namespace Example1
{
public class Program
{
public static void Main (string[] args)
{
using (var streamer = new AudioStreamer ("ws://agektmr.node-ninja.com:3000/socket"))
//using (var streamer = new AudioStreamer ("ws://localhost:3000/socket"))
{
string name;
do {
Console.Write ("Input your name> ");
name = Console.ReadLine ();
}
while (name.Length == 0);
streamer.Connect (name);
Console.WriteLine ("\nType 'exit' to exit.\n");
while (true) {
Thread.Sleep (1000);
Console.Write ("> ");
var msg = Console.ReadLine ();
if (msg == "exit")
break;
streamer.Write (msg);
}
}
}
}
}