I've created a server that just prints out a line whenever a new request is received:
var server = new AppServer();
if (!server.Setup(2012) || !server.Start()) {
return;
}
server.NewSessionConnected += (session) => Console.WriteLine("new connection");
server.NewRequestReceived += (session, requestInfo) => Console.WriteLine("new request");
I connect to it from netcat:
C:\Users\sashoalm>nc localhost 2012 test test ^C C:\Users\sashoalm>
It prints new connection
but never prints new request
, despite typing 2 lines from netcat. I know that netcat sends the text to the server each time a full line has been typed (that's how netcat works).
Edit: I found another (not very well worded) unanswered question that might be asking the same thing - How to send data to server using supersocket library, but I'm not entirely sure if it's the same problem. The guy there tries to send data from code it seems.
Another related question - C# SuperSocket without protocol. They talk about protocols there. Is there a default protocol in SuperSocket when you don't specify one? Is it HTTP or something else?