Created
December 1, 2012 16:33
-
-
Save somdoron/4183132 to your computer and use it in GitHub Desktop.
connect performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
using (Context context = Context.Create()) | |
{ | |
using (var socket1 = context.CreateResponseSocket()) | |
{ | |
socket1.Bind("tcp://127.0.0.1:82"); | |
while (true) | |
{ | |
Stopwatch sw = Stopwatch.StartNew(); | |
using (var socket2 = context.CreateRequestSocket()) | |
{ | |
socket2.Connect("tcp://127.0.0.1:82"); | |
sw.Stop(); | |
} | |
Console.WriteLine(sw.ElapsedMilliseconds); | |
Thread.Sleep(1000); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment