Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Server.java
Package: java五子棋.zip [view]
Upload User: ptnike
Upload Date: 2007-06-15
Package Size: 61k
Code Size: 1k
Category:
Chess Poker games
Development Platform:
Java
- import java.io.*;
- import java.net.*;
- import java.util.ArrayList;
- /**
- * <p>Title: chess server</p>
- * <p>Description: chess server</p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: e-top</p>
- * @author cylix
- * @version 1.0
- */
- public class Server {
- public static final int PORT = 8180;
- public static ArrayList playerList = new ArrayList();
- public static ArrayList groupList = new ArrayList();
- public static void main(String[] args)throws IOException {
- ServerSocket s = new ServerSocket(PORT);
- System.out.println("Welcome using ChessWZQ1.0 server (alpha test)...nAuthor:cylixnCopyright:e-topnMail:cylix_xtcc@sina.com");
- System.out.println("Server Started at port "+PORT+"...");
- try {
- while(true) {
- // Blocks until a connection occurs:
- Socket socket = s.accept();
- try {
- ServeOneClient server = new ServeOneClient(socket);
- Player client = new Player();
- client.selfSocket = server;
- playerList.add(client);
- //System.out.println("create a socket frome server");
- } catch(IOException e) {
- // If it fails, close the socket,
- // otherwise the thread will close it:
- socket.close();
- }
- }
- } finally {
- s.close();
- }
- }
- }///:-)