登录
首页 » 套接字网络编程 » java socket网络编程代码(含服务端和客户端)

java socket网络编程代码(含服务端和客户端)

于 2022-04-17 发布 文件大小:6.31 kB
0 169
下载积分: 2 下载次数: 1

代码说明:

本代码是java socket网络编程源码,包含服务端和客户端,实现客户端发送消息,服务端接收并反馈消息。首先,需要准备好java环境,我使用的是jdk1.8。socket文件夹为eclipse项目原文件,可以直接导入eclipse编译运行。如果不想看项目文件,可以直接查看代码:server.java为服务端代码。client.java为客户端代码。先运行server,显示:“Waiting for client.”表示启动成功。再运行client,显示:“server reply:I have accepted.”,表示发送并受到服务端的反馈消息。这时再看服务端,显示:“recv: hello, i am wang.”,表示收到客户端发来的消息。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • a telephone dial
    一个利用电话拨号上网进行电话通信的程序!(得用modem,好象不能用宽带!)-a telephone dial-up telephone communications procedures! (Starting a modem, it seems not use broadband!)
    2022-01-25 17:33:40下载
    积分:1
  • / *
    /* Here s a small IPv4 example: it asks for a portbase and a destination and starts sending packets to that destination. 这个IPv4版的例子:它要求portbase(本地端口)与destination (目的端口)然后发送消息 同时还监听消息。 例子测试一: 启动一个运行实例,本地地址与目标地址用同一个端口8888 例子测试二: 启动两个运行实例,本地地址与目标地址用不同的端口(它要求是偶数端口号) 两个实例互发 例子的中文解释都由hanyuejun添加,有任何疑问请发hanyuejun2006@163.com */-/* Here sa small IPv4 example: it asks for a portbase and a destination and starts sending packets to that destination. The IPv4 version of the example: It requires portbase (local port) and destination (destination port) and then send a message but also monitor the news . Examples of test 1: Start a running instance, a local address with the destination address port 8888 using the same test two examples: the two start to run instances, the local address and destination address with a different port (it requires the port number is even) two examples of inter- examples of explanation issued by the Chinese hanyuejun add, have any questi
    2022-11-02 16:55:03下载
    积分:1
  • 学生信息管理,大大提高学校对学生管理的能力!
    学生信息管理,大大提高学校对学生管理的能力!-good
    2022-10-12 01:35:03下载
    积分:1
  • Makesolutions站开发素材包.rar
    Makesolutions网站开发素材包.rar-Makesolutions web site development and materials packet. Rar
    2022-12-01 04:10:04下载
    积分:1
  • 一个PERL写CGI时用的模板序,也是以前做项目用的,很好的,大家用用看。...
    一个PERL写CGI时用的模板程序,也是以前做项目用的,很好的,大家用用看。-PERL to write a CGI program when the template is also used in previous projects to do, well, everyone used to use watch.
    2022-02-16 05:32:43下载
    积分:1
  • 一个聊天室源码 cooo ooo l
    一个聊天室源码 cooo ooo l-a chat room source cooo ooo ooo l
    2022-03-21 07:47:53下载
    积分:1
  • apache 非阻塞通信框架,非常好,但有些地方比较难,至今没研究明白。...
    apache 非阻塞通信框架,非常好,但有些地方比较难,至今没研究明白。-apache framework for non-blocking communication, very good, but more difficult in some places, so far no research to understand.
    2022-01-24 16:48:30下载
    积分:1
  • 超快速的多文件传送源码,在本地局域上可达到1.8Mb+的速度,超牛的代码,VB写的,可以多多研究,保证收获...
    超快速的多文件传送源码,在本地局域网上可达到1.8Mb+的速度,超牛的代码,VB写的,可以多多研究,保证收获-ultra-fast transmission of multi-source documents in the local LAN delivers up to speed, super-cattle code, written in VB, deserves more research, a lot ensure harvest
    2022-03-30 09:47:28下载
    积分:1
  • 以太交换机私有协议,能实现快速环功能,类似于RAPP协议
    以太网交换机私有协议,能实现快速环网功能,类似于RAPP协议-the network provite protocol for Ring,the same the RAPP protocol....
    2022-10-03 06:30:03下载
    积分:1
  • 最新的视频开发包哦
    最新的视频开发包哦-latest Video Development Kit oh
    2022-01-25 17:51:56下载
    积分:1
  • 696518资源总数
  • 105873会员总数
  • 12今日下载