- 1、本文档共14页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
/*
* Copyright (c) 2000 David Flanagan. All rights reserved.
* This code is from the book Java Examples in a Nutshell, 2nd Edition.
* It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
* You may study, use, and modify it for any non-commercial purpose.
* You may distribute it non-commercially as long as you retain this notice.
* For a commercial use license, or to purchase the book (recommended),
* visit /javaexamples2.
*/
import java.io.*;
import .*;
import java.util.*;
/**
* This class is a generic Framework for a flexible, multi-threaded server.
* It listens on any number of specified ports, and, when it receives a
* connection on a port, passes input and output streams to a specified Service
* object which provides the actual service. It can limit the number of
* concurrent connections, and logs activity to a specified stream.
**/
public class Server {
/**
* A main() method for running the server as a standalone program. The
* command-line arguments to the program should be pairs of servicenames
* and port numbers. For each pair, the program will dynamically load the
* named Service class, instantiate it, and tell the server to provide
* that Service on the specified port. The special -control argument
* should be followed by a password and port, and will start special
* server control service running on the specified port, protected by the
* specified password.
**/
public static void main(String[] args) {
try {
if (args.length 2) // Check number of arguments
throw new IllegalArgumentException(Must specify a service);
// Create a Server object that uses standard out as its log and
// has a limit of ten concurrent connections at once.
Server s = new Server(System.out, 10);
// Parse the argument list
int i = 0;
while(i args.length) {
if (args[i].e
您可能关注的文档
- “可真多好”字感叹句.doc
- 新版关于如何延长方形轴承寿命的常用方法及方形轴承质量判断方法.doc
- 《导游实务》教案(一认识导游员).doc
- 新版关于如何延长带座型轴承寿命的常用方法.doc
- 《翻译》必威体育精装版发布的中译英词汇.doc
- 姜韧建设文化徐汇——发展创意产业.doc
- 新版一级建造师教材.doc
- 教继教培训教案.doc
- 学二学期初中数学教育教研工作计划.doc
- 教育学心理学名词解释大全(整理).doc
- 2025年金肯职业技术学院单招职业适应性测试题库带答案.docx
- 2025年钦州幼儿师范高等专科学校单招综合素质考试题库完美版.docx
- 2025年钟山职业技术学院单招职业适应性考试题库参考答案.docx
- 2025年金华职业技术学院单招职业技能测试题库附答案.docx
- 2025年闽南理工学院单招职业技能测试题库审定版.docx
- 2025年闽南理工学院单招综合素质考试题库审定版.docx
- 2025年闽南理工学院单招职业倾向性考试题库汇编.docx
- 2025年闽南理工学院单招职业倾向性考试题库推荐.docx
- 2025年闽北职业技术学院单招综合素质考试题库1套.docx
- 2025年长沙轨道交通职业学院单招职业技能考试题库一套.docx
最近下载
- 2024山东职业学院招聘笔试真题及答案详解一套.docx VIP
- 人教版2025四年级上册英语unit1 Unit 1 Helping at home A Let’s talk 课件.pptx
- 软件六性分析报告.docx
- 党委书记巡察整改专题生活会个人对照检查材料.docx VIP
- 市政调蓄池施工组织设计要点.doc
- csc-306gz数字式发电机转子接地保护装置说明书0sf.450.v1.pdf VIP
- 2016款一汽丰田荣放RAV4_汽车使用手册用户操作图解驾驶车主车辆说明书电子版.pdf
- 小儿遗传性疾病.ppt
- 第三课 卖辣椒的女孩儿.pptx VIP
- F420002【复试】2024年青海师范大学077501计算机系统结构《复试数据结构和操作系统之计算.pdf VIP
文档评论(0)