Reputation: 107
Does go standard "net" package support TCP simultaneous open? I mean two hosts actively open a tcp connection to each other and build one connection. I used net.Dialer and Dial but got connection refused.
Upvotes: 0
Views: 347
Reputation: 23567
Simultaneous open isn't a feature, but rather something that can happen if two clients try connecting to each other at the same time. So Go supports this just by virtue of supporting the normal TCP operations. The reason you're probably getting connection refused is that the timing has to be very precise. Both sides have to register their handlers with the kernel before the other side's SYN arrives. For two clients on the same network (say in the same building or on the same campus), this latency will be incredibly low, and the window will thus be very small (a few tens of milliseconds at most).
Upvotes: 4