socket&tcp&udp&http
文章平均质量分 93
王新春
这个作者很懒,什么都没留下…
展开
-
socket-长连接&短连接
的短链接,浏览器和服务器每进行一次HTTP操作,就建立一次连接,但任务结束就中断连接。 具体就是 浏览器client发起并建立TCP连接 -> client发送HttpRequest报文 -> server接收到报文->server handle并发送HttpResponse报文给前端,发送完毕之后立即调用socket.close方法->client接收response报文->client最终会收到server端断开TCP连接的信号-&a原创 2017-04-18 18:52:28 · 67 阅读 · 0 评论 -
socket-client-http-get
.168.237.230Connection: close response:HTTP/1.1 200 OKServer: Apache-Coyote/1.1Set-Cookie: JSESSIONID=2D3FE2C8EA372E3ACC69C48E12348B44; Path=/Content-Type: text/html;charset=ISO-8859-1Content-Length: 288Date: Tue, 25 Apr 2017 03:06:572017-04-25 11:03:55 · 92 阅读 · 0 评论 -
socket-client-http-post
Connection: closeContent-Length:42username=xinchun.wang&password=123456..... 响应数据:HTTP/1.1 200 OKServer: Apache-Coyote/1.1Set-Cookie: JSESSIONID=613C816BEC2DB87DB7A043574B68AA57; Path=/Content-Type: text/html;charset=ISO-8859-12017-04-25 11:08:48 · 78 阅读 · 0 评论 -
socket-server-http
import java.io.InputStream;import java.io.OutputStream;import java.net.ServerSocket;import java.net.Socket;/** * @author xinchun.wang */public class HttpServer { private static final int PORT = 9111; public static void main(String[2017-04-25 14:50:32 · 81 阅读 · 0 评论 -
http-post(收藏)
原创 2017-05-03 14:37:51 · 143 阅读 · 0 评论 -
http-post-upload 格式
上传,http协议通过定义:boundary=---------------------------7e131a1ade2200 来实现每个字段域直接的分割针对普通的文本域,比如:username,password等 -----------------------------7e131a1ade2200Content-Disposition: form-data; name="username"xinchun.wang--------------------2017-05-03 16:48:27 · 268 阅读 · 0 评论