SampleListener

September 15, 2020 ยท View on GitHub

A sample echo server in BeefLang

A program that exemplifies the use of the System.Net.Socket structure in BeefLang.

  • It binds the listener to localhost on given port (9092 in the example);
  • Waits until a client connection is accepted;
  • Then, it receives the sended data by a client, print in console, then, echo back;

JMeter result with equivalent programs in different languages:

Params:

  • Address: 127.0.0.1
  • Port: 9092
  • Threads: 2
  • Send for: 20 seconds
  • Text to send: Hello
Lang and implementationSamplesError(%)Throughput(Req/s)
Java with ServerSocket310850.01554
C# with TcpListener206810.01034
C# with HPSocket.Net104380.0522
BeefLang Socket164942.7825