Using a java socket from JNI / C++ code

后端 未结 5 1545
抹茶落季
抹茶落季 2021-01-02 05:02

I have a java app that creates a socket to talk to a server process, eg new java.net.Socket(String host, int port). This app includes a bunch of legacy c++ code that needs t

5条回答
  •  鱼传尺愫
    2021-01-02 05:48

    Your second question-

    You can always 'bind' to the local interface you want (just need the the Ip address for it)

    public void bind(SocketAddress addr) throws SocketExceptionBinds this DatagramSocket to a specific address & port

提交回复
热议问题