aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
diff options
context:
space:
mode:
authorAdam Frisby2009-05-30 03:18:09 +0000
committerAdam Frisby2009-05-30 03:18:09 +0000
commitac80b6539f81018122f211c26805d4a9f9da32ff (patch)
treead9bb4bf5f9b8a6d07003b1c2936c1ddfa5a05d3 /OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
parent* Adds World.Audio.* to MRM (diff)
downloadopensim-SC-ac80b6539f81018122f211c26805d4a9f9da32ff.zip
opensim-SC-ac80b6539f81018122f211c26805d4a9f9da32ff.tar.gz
opensim-SC-ac80b6539f81018122f211c26805d4a9f9da32ff.tar.bz2
opensim-SC-ac80b6539f81018122f211c26805d4a9f9da32ff.tar.xz
* May partially implement a C# IRCd & IRCClientStack.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
new file mode 100644
index 0000000..4b39b92
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
@@ -0,0 +1,47 @@
1using System;
2using System.Collections.Generic;
3using System.Net;
4using System.Net.Sockets;
5using System.Text;
6using System.Threading;
7
8namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
9{
10 /// <summary>
11 /// Adam's completely hacked up not-probably-compliant RFC1459 server class.
12 /// </summary>
13 class IRCServer
14 {
15 private TcpListener m_listener;
16 private bool m_running = true;
17
18 public IRCServer(IPAddress listener, int port)
19 {
20 m_listener = new TcpListener(listener, port);
21
22 m_listener.Start(50);
23
24 Thread thread = new Thread(ListenLoop);
25 thread.Start();
26 }
27
28 public void Stop()
29 {
30 m_running = false;
31 m_listener.Stop();
32 }
33
34 private void ListenLoop()
35 {
36 while(m_running)
37 {
38 AcceptClient(m_listener.AcceptTcpClient());
39 }
40 }
41
42 private void AcceptClient(TcpClient client)
43 {
44
45 }
46 }
47}