具有并发I/O的Java套接字编程 [英] Java Socket Programming with concurrent I/O

查看:67
本文介绍了具有并发I/O的Java套接字编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚得到一个任务,就是设计一个Java套接字服务器来接受传入的客户端连接.服务器的工作是接受它并跟踪所有连接的客户端,并且必须将连接的客户端列表通告给所有连接的客户端.我是Java的新手.我只知道必须在线程的帮助下完成此任务.我对Java I/O,网络和线程有一定的了解.但是我无法协作所有这些概念在一个单一的应用程序中.如果有人提供一个模型程序,或者也许如何进行下去,那将是有帮助的.

I just got an assignment.It is to design a java socket server which accepts incoming client connections.The server's job is to accept it and keep track of all the connected clients and it has to advertise the connected client list to all the clients that connect.I am a newbie to Java.I just know that this task has to be completed with the help of threads.I have some knowledge in Java I/O,Networking and Threads.But I am unable to collaborate all these concepts in one single application.It would be helpful if someone would give a model program,or perhaps how to proceed,then it would be helpful.

谢谢, Madhu

推荐答案

教程应向您展示并发服务器的基础知识. 是另一本您可能想看的教程出色地.第二个涉及线程和并发.

This tutorial should show you the basics on concurrent servers. This is another tutorial you might want to look at as well. The second deals more with threading and concurrency.

这篇关于具有并发I/O的Java套接字编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆