Socket.listen([options]): open a TCP or UNIX listening socket. Returns a Promise that receives a SocketListener. Defaults to listening on both IPv4 and IPv6, if supported, and binding on all interfaces on a randomly selected TCP port.
Socket.connect(options): connect to a TCP or UNIX server. Returns a Promise that receives a SocketConnection.
Socket.type(handle): inspect the OS socket handle and return its type as a string which is either tcp, udp, tcp6, udp6, unix:stream, unix:dgram, or null if invalid or unknown.
Socket.localAddress(handle), Socket.peerAddress(handle): inspect the OS socket handle and return its local or peer address, or null if invalid or unknown. The object returned has the fields:
ip: (IP sockets) IP address as a string.port: (IP sockets) IP port as a number.path: (UNIX sockets) UNIX path as a string.All methods are fully asynchronous and return Promise objects.
path: (UNIX family) path being listened on.port: (IP family) IP port being listened on.close(): close the listener, releasing resources related to it. Once the listener is closed, all other operations will fail. Closing a listener multiple times is allowed and will not result in an error.accept(): wait for the next client to connect. The returned Promise receives a SocketConnection.Inherits from IOStream. All methods are fully asynchronous and return Promise objects.
setNoDelay(noDelay): disable the Nagle algorithm if noDelay is true, otherwise enable it. The Nagle algorithm is enabled by default, so it is only necessary to call this method if you wish to optimize for low delay instead of high throughput.运行结果如下,可以看出successMessage的类型是SocketConnection。
在发出去的数据还没有被确认之前,假如又有小数据生成,那么就把小数据收集起来,凑满一个MSS或者等收到确认后再发送。
instanceof 是用来判断 A 是否为 B 的实例,表达式为:A instanceof B,如果 A 是 B 的实例,则返回 true,否则返回 false。 在这里需要特别注意的是:instanceof 检测的是原型。 由上图可以看出[]的原型指向Array.prototype,间接指向Object.prototype, 因此 [] instanceof Array 返回true, [] instanceof Object 也返回true。
其他的判断方式
typeoftoString Object.prototype.toString.call(window) ; //[object global] window 是全局对象 global 的引用constructor更多Frida相关内容,欢迎关注我的微信公众号:无情剑客。