Recently, I'm learning Supersocket. I made telnet Supersocket with this example.
When I try to access with telnet, server returnes Operation is not supported on this platform.
Below is error messages.
Press and key to start the server!
d
The server started successfully, press key 'q' to stop it!
Unhandled exception. System.PlatformNotSupportedException: Operation is not supported on this platform.
at SuperSocket.SocketBase.SessionHandler`1.BeginInvoke(TAppSession session, AsyncCallback callback, Object object)
at SuperSocket.SocketBase.AppServerBase`2.OnNewSessionConnected(TAppSession session)
at SuperSocket.SocketBase.AppServerBase`2.SuperSocket.SocketBase.IAppServer.RegisterSession(IAppSession session)
at SuperSocket.SocketEngine.AsyncSocketServer.RegisterSession(IAppSession appSession)
at SuperSocket.SocketEngine.AsyncSocketServer.ProcessNewClient(Socket client, SslProtocols security)
at SuperSocket.SocketEngine.AsyncSocketServer.OnNewClientAccepted(ISocketListener listener, Socket client, Object state)
at SuperSocket.SocketEngine.SocketListenerBase.OnNewClientAccepted(Socket socket, Object state)
at SuperSocket.SocketEngine.TcpAsyncSocketListener.ProcessAccept(SocketAsyncEventArgs e)
at SuperSocket.SocketEngine.TcpAsyncSocketListener.acceptEventArg_Completed(Object sender, SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompletedInternal()
at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.Sockets.SocketAsyncEventArgs.<>c.<.cctor>b__179_0(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading.ThreadPoolBoundHandleOverlapped.CompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)
Server.cs
using SuperSocket.SocketBase;
Console.WriteLine("Press and key to start the server!");
Console.ReadKey();
Console.WriteLine();
var appServer = new AppServer();
static void appServer_NewSessionConnected(AppSession session){
session.Send("Welcom to SuperSocket Telnet Server");
}
if (!appServer.Setup(2023))
{
Console.WriteLine("Failed to setup!");
Console.ReadKey();
return;
}
Console.WriteLine();
if (!appServer.Start())
{
Console.WriteLine("Failed to start!");
Console.ReadKey();
return;
}
appServer.NewSessionConnected += new SessionHandler<AppSession>(appServer_NewSessionConnected);
Console.WriteLine("The server started successfully, press key 'q' to stop it!");
while (Console.ReadKey().KeyChar != 'q')
{
Console.WriteLine();
continue;
}
//Stop the appServer
appServer.Stop();
Console.WriteLine("The server was stopped!");
Console.ReadKey();
What's wrong with my code? I activated window function of telnet client.