Socket选择可以指定Socket类发送和接受数据的方式.在JDK1.4中共有8个Socket选择可以设置.这8个选项都定义在java.net.SocketOptions接口中.定义如下: public final static int TCP_NODELAY = 0x0001; public final static int SO_REUSEADDR = 0x04; public final static int SO_LINGER = 0x0080; public final static…
what is websockets Two-way communication over ont TCP socket, a type of PUSH technology HTML5的新特性,用于双向推送消息(例如网页聊天,手机推送消息等) 原理: client利用regular http请求webpage 请求的webpage 执行javascript脚本,open a connection to server. 有新的信息时服务器和客户端可以相互发送信息(Real-time traffi…