forked from sta/websocket-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
37 lines (32 loc) · 845 Bytes
/
Program.cs
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
36
37
using System;
using System.Threading;
namespace Example1
{
public class Program
{
public static void Main (string[] args)
{
// The AudioStreamer class provides a client (chat) for AudioStreamer
// (https://github.com/agektmr/AudioStreamer).
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);
}
}
}
}
}