forked from ngraziano/SharpRTSP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (30 loc) · 1.03 KB
/
Program.cs
File metadata and controls
36 lines (30 loc) · 1.03 KB
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
using System;
using System.Threading;
namespace RtspCameraExample
{
class Program
{
static void Main(string[] args)
{
int port = 8554;
string username = "user"; // or use NUL if there is no username
string password = "password"; // or use NUL if there is no password
RtspServer s = new RtspServer(port,username,password);
s.StartListen();
// Wait for user to terminate programme
String msg = "Connect RTSP client to Port=" + port;
if (username != null && password != null) {
msg += " Username=" + username + " Password=" + password;
}
Console.WriteLine(msg);
Console.WriteLine("Press ENTER to exit");
String readline = null;
while (readline == null) {
readline = Console.ReadLine();
// Avoid maxing out CPU on systems that instantly return null for ReadLine
if (readline == null) Thread.Sleep(500);
}
s.StopListen();
}
}
}