-
-
Save MoimHossain/b20aec0736cdeb782500d9a8e443c123 to your computer and use it in GitHub Desktop.
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
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