集册 Java实例教程 本地SocketAddress

本地SocketAddress

欢马劈雪     最近更新时间:2020-01-02 10:19:05

450
本地SocketAddress
/**来 自 nowjava.com - 时  代  Java**/

//package com.nowjava;

import java.io.IOException;

import java.net.InetAddress;

import java.net.InetSocketAddress;

import java.net.SocketAddress;


public class Main {

    public static void main(String[] argv) throws Exception {

        int port = 2;

        System.out.println(localAddress(port));

    }


    private static final byte[] IPV4_LOCALHOST = new byte[] { 127, 0, 0, 1 };


    public static SocketAddress localAddress(final int port)

            
展开阅读全文