[Zerofile-svn] SF.net SVN: zerofile: [53] trunk/src/XMPPSessionListener.java
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <kar...@us...> - 2007-11-21 11:01:16
|
Revision: 53
http://zerofile.svn.sourceforge.net/zerofile/?rev=53&view=rev
Author: karl-bengtsson
Date: 2007-11-21 03:01:21 -0800 (Wed, 21 Nov 2007)
Log Message:
-----------
Missed committing this crusial file last time.
Added Paths:
-----------
trunk/src/XMPPSessionListener.java
Added: trunk/src/XMPPSessionListener.java
===================================================================
--- trunk/src/XMPPSessionListener.java (rev 0)
+++ trunk/src/XMPPSessionListener.java 2007-11-21 11:01:21 UTC (rev 53)
@@ -0,0 +1,38 @@
+import java.io.*;
+import java.net.*;
+
+public class XMPPSessionListener {
+ static private ServerSocket _listeningSock;
+
+ private static Thread _listenerThread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ while(true)
+ {
+ Socket connection = _listeningSock.accept();
+ new XMPPLinkLocalChatSession(connection);
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ }
+ };
+
+ public static void startListening(int portNr)
+ {
+ try
+ {
+ _listeningSock = new ServerSocket(portNr);
+ _listenerThread.start();
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|