您当前的位置: 首页 >  网络

段智华

暂无认证

  • 0浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

JAVA 网络编程 Socket server client 编程

段智华 发布时间:2016-02-10 11:51:41 ,浏览量:0

1、网络侧开发

 

package com.dt.java.test;

import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket;

public class JavaNet {

 public static void main(String[] args) throws Exception {   /*   InetAddress  local =null;    InetAddress remote = null;    local = InetAddress.getLocalHost();    remote= InetAddress.getByName("www.baidu.com");          System.out.println("Local ip " + local.getHostAddress() );          System.out.println("remote ip  "+remote.getHostAddress());       URL url = new URL("http://www.baidu.com");       InputStream inputStream = url.openStream();             Scanner scanner =new Scanner(inpu

关注
打赏
1659361485
查看更多评论
立即登录/注册

微信扫码登录

0.0393s