Skip to content

Instantly share code, notes, and snippets.

@MoimHossain

MoimHossain/WCF-Server Secret

Last active Sep 2, 2019
Embed
What would you like to do?
private static void Server()
{
try
{
Console.Clear();
// use WcfService.Tcp for NetTcp binding or WcfService.Http for WSHttpBinding
var hosts = WcfService.DefaultFactory.CreateServers(
new List<Type> { typeof(MyService) },
(t) => { return t.Name; },
(t) => { return typeof(IWcf); },
"WcfServices",
port,
(sender, exception) => { Trace.Write(exception); },
(msg) => { Trace.Write(msg); },
(msg) => { Trace.Write(msg); },
(msg) => { Trace.Write(msg); });
Console.WriteLine($"Server started .... {NetworkUtils.GetLocalIPAddress()}:{port}");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.