Which is fast URLConnection or Socket

前端 未结 5 763
野的像风
野的像风 2021-01-06 07:45

For getting data from remote url which connection type will work fast URLConnection or Socket.

5条回答
  •  情书的邮戳
    2021-01-06 07:52

    Although it depends on the type of data, server etc.
    I agree with r0ast3d.

    According to me if server allows both the things, then I would prefer to use URLConnection.
    Both sends data using streams, but wait mode in Socket is bit high than in URLConnection.

    Please correct me If I am wrong.

提交回复
热议问题