diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2013-12-04 10:50:36 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2013-12-04 10:50:36 +0200 |
commit | 3bbbd95c8d2d6f3185b0f3e48263f36ba4bb0e75 (patch) | |
tree | b336db15d08ab911658a646a6b7f3e6bf011be28 /src/Server/ChatServer.java | |
parent | d57f9416a9d4bb92d4111f73af278f607bbe78b9 (diff) |
Convert source to NL-terminated
Diffstat (limited to 'src/Server/ChatServer.java')
-rw-r--r-- | src/Server/ChatServer.java | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/Server/ChatServer.java b/src/Server/ChatServer.java index e2d98f4..f9a233f 100644 --- a/src/Server/ChatServer.java +++ b/src/Server/ChatServer.java @@ -1,46 +1,46 @@ -package Server;
-import java.net.*;
-import java.io.*;
-import java.util.LinkedList;
-
-public class ChatServer
-{
- private ServerSocket service;
- private LinkedList<Connection> connections;
-
- public static final int portNum = 6667;
-
- ChatServer() throws IOException {
- this.service = new ServerSocket(portNum);
- this.connections = new LinkedList<Connection>();
- }
- /** Listening to port and opening a socket */
- public static void main(String[] args) throws IOException
- {
- ChatServer server;
- try
- {
- server = new ChatServer();
- } catch (IOException e)
- {
- System.err.println("Failed listening on port " + portNum + " (" + e + ")");
- return;
- }
-
- Socket soc = null;
- try
- {
- while (true)
- {
- soc = server.service.accept();
- Connection con = new Connection(soc);
- server.connections.add(con);
- con.start();
- }
- } catch (IOException e)
- {
- System.out.println(e);
- }
-
- }
-}
+package Server; +import java.net.*; +import java.io.*; +import java.util.LinkedList; + +public class ChatServer +{ + private ServerSocket service; + private LinkedList<Connection> connections; + + public static final int portNum = 6667; + + ChatServer() throws IOException { + this.service = new ServerSocket(portNum); + this.connections = new LinkedList<Connection>(); + } + /** Listening to port and opening a socket */ + public static void main(String[] args) throws IOException + { + ChatServer server; + try + { + server = new ChatServer(); + } catch (IOException e) + { + System.err.println("Failed listening on port " + portNum + " (" + e + ")"); + return; + } + + Socket soc = null; + try + { + while (true) + { + soc = server.service.accept(); + Connection con = new Connection(soc); + server.connections.add(con); + con.start(); + } + } catch (IOException e) + { + System.out.println(e); + } + + } +} |