- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
一个简单的c_s多线程应用(A simple c_s multithreaded application).doc
一个简单的c_s多线程应用(A simple c_s multithreaded application)
A simple multi-threaded application C/S, a little expansion can be used
/*socket is the core of network applications, and socket is an essential element in server side or client network applications
* common applications on the server are: FTP server, MAIL server (SMTP, POP3, IMAP4 protocol), WEB (HTTP protocol)
* the application steps for building server-side SOCKET are as follows:
*1. Create server side SOCKET and listen for client connection requests
*2. When the server detects a connection request from the client, it receives the request and establishes the clients SOCKET, which will be used as the SOCEKT
* client connections and subsequent processing, sending and receiving data on the basis, so far, the server and the client to complete the SOCKET communication link
*3. Processing information from a client, commonly called a request, can be considered as a clients instruction requirement. For example, the URL request for the HTTP communication protocol,
* or FTP commands for FTP communication protocols (such as GET, PUT, etc.)
*4. According to the request from the client, the server needs to be processed by program logic, and then send back the corresponding result or error information to the server
* clients, such as HTTP servers, have to send back the contents of the HTML page, while the FTP server sends back the results of the FTP command
*5. When the program finishes processing data or commands, it closes the SOCKET communication link
* /
*
SimpleServer.java
* /
Import .*;
Import java.io.*;
Public class simpleServer
{
Private static ServerSocket serverSocket;
Private static listenClient listen;
Public, static, void, main (String[], args) throws Exception
{
Int port;
If (args.length==0)
{
System.out.println (Usage:java simpleServer [port]);
System.exit (1);
}
Port=Integer.parseInt (args[0]);
StartServer (port);
}
Public, static, void, startServer (int, port) throws Exception
{
Try
{
ServerSocket=new Serve
您可能关注的文档
- 北京2011年自考动画专业(独立本科段)“二维动画”考试大纲.doc
- 新视野大学英语视听说教程(第二版)quizTest.doc
- jack sparrow(杰克·斯派洛).doc
- 计算机常用英语词汇大全(很实用)(Computer commonly used English vocabulary Daquan (very practical)).doc
- 会计电算化实务操作题培训教材(用友T).doc
- 性别因素对HIV感染者免疫学功能变化和疾病进程的影响.doc
- 高中老师给学生的赠言.doc
- 计算机应用基础实训指导书-上.doc
- 千里马餐饮管理系统V用户手册.doc
- 我的心声作文字.doc
- 年考研英语阅读精解及高频词汇.doc
- 实用资料世界三大佛教艺术最珍贵遗产之印度阿旃陀古石窟探秘图.doc
- 项目成本及销售估算表.doc
- 《戏曲研究》-集目录 - 中国民族民间音乐概论.doc
- 电话销售 客户分类 客户类型 解决方案.doc
- 红狮环保 水泥窑协同处置项目环评.docx
- 世纪中国近代文学研究的曲折历程.doc
- 2010年全国自考基础会计学模拟试卷(六)(2010 national self taught basic accounting simulation paper (six)).doc
- 金算盘金财工程解决方案简介V[]..doc
- BDTC2015-南京大学:基于R语言的跨平台大数据机器学习与数据分析系统.doc
文档评论(0)