使用以下服务器和客户端结构 编写一个储存考试结果的共享服务器。 服务器有所有给出科目的学生的考试结果。每个学生有单独I D 学生号和mark(分数 。 服务器需要可以让老师登录然后输入每个学生的分数。服务器管理所有的老师的登录名和密码和学生ID。
服务器需要允许多个老师同时登录。importjava. io.*;*importjava.net. ;class…Server {final static int portSqrt=1234; //any number>1024publ icstatic void main(String[]args) {
Screen.message("Server running . . .");try{
ServerSocket servesock=new ServerSocket(portSqrt);
//for service requests on port portSqrtwhi le(true) {
//wait for a service request on port portSqrt
Socket socket=servesock.accept();
//start thread to service request
(new Thread(new ThreadName(socket))).start();
}
}catch(IOException e) {}
}
}importjava. io.*;*importjava.net. ;class. .Cl ient {private final static i nt port=1234;publ icstatic void main(String[]args) {try{
Socket socket;socke=t=new Socket(InetAddress.getLocalHost(),portSqrt);
…in new…(socket.getInputStream());
…out=new…(socket.getOutp utStream());
//use out to send data
//use in to get reply
//process replysocket.close();
}catch(IOException e) {System.out.pri ntln(e);}
}
}
-------------------------------------------------------------------------------------------------------
Using the client server architecture developed in the lecture course,write a server thatprovides access to a shared collection of examination results. The server holds theresults for all students in a given course.Each student has an id number and a mark.When a student logs on they enter their id number and the server returns the mark forthe examination. It should be possible for a lecturer to log on and enter marks forstudents.The server maintains a list of lecturers and their passwords and also a list ofstudent id numbers. It is important to remember that multiple lecturers may enterresults at the same time.
puaex怎么样?puaex是一家去年成立的国人商家,本站也分享过几次,他家主要销售香港商宽的套餐,给的全部为G口带宽,而且是不限流量的,目前有WTT和HKBN两种线路的方面,虽然商家的价格比较贵,但是每次补一些货,就会被抢空,之前一直都是断货的状态,目前商家进行了补货,有需要这种类型机器的朋友可以入手。点击进入:puaex商家官方网站Puaex香港vds套餐:全部为KVM虚拟架构,G口的带宽,可...
提速啦简单介绍下提速啦 是成立于2012年的IDC老兵 长期以来是很多入门级IDC用户的必选商家 便宜 稳定 廉价 是你创业分销的不二之选,目前市场上很多的商家都是从提速啦拿货然后去分销的。提速啦最新物理机活动 爆炸便宜的香港CN2物理服务器 和 日本CN2物理服务器香港CTG E5 2650 16G内存 20M CN2带宽 1T硬盘 150元/月日本CN2 E5 2650 16G内存 20M C...
很久没有分享PhotonVPS的消息,最近看到商家VPS主机套餐有一些更新所以分享下。这是一家成立于2008年的国外VPS服务商,Psychz机房旗下的站点,主要提供VPS和独立服务器等,数据中心包括美国洛杉矶、达拉斯、芝加哥、阿什本等。目前,商家针对Cloud VPS提供8折优惠码,优惠后最低2G内存套餐每月4美元起。下面列出几款主机配置信息。CPU:1core内存:2GB硬盘:30GB NVm...