RobotStudio event

socket program sample code

i am using socket programming.virtual controller is the client and my c# program is the server,both running on the same pc.I will write a rapid program which listens for the data from server,but i don't know how to write c# program as socket server.

can you send me a sample code both c# program(socket server) and rapid program(socket client) ?

thanks a lot!