Using custom SocketServerFactory

Mar 23, 2014 at 5:03 PM

While using SuperSocket, I want to implement my own SocketServerFactory. Looking at the code, it seems possible to implement this and enable it through the configuration.

I just can't find out how to setup the app.config to use my own SocketServerFactory. Is it possible? And, if yes, how can I do this?

Kind regards,

Mar 23, 2014 at 5:25 PM
Why do you want to implement your own SocketServerFactory?
Mar 23, 2014 at 5:31 PM
I'm trying to add a ISocketServer implementation that reads commands from files. Right now I need it for testing purposes.
Mar 23, 2014 at 5:37 PM
You are on the wrong road.

What you should do is implementing your own command loader.
Mar 23, 2014 at 5:50 PM
No, you misunderstand me.

I want to add the filesystem as a "protocol" (besides TCP and UDP) to be able to read files and test the SuperSocket (and my custom command implementation). So in stead of getting commands from a TCP connection, this implementation reads files and handles the content of the file as a command received from a TCP connection.

Could you please tell me if it is possible or not. The other solution is to use the source in stead of the compiled version, but then I would have to edit the source on every update of SuperSocket (and that is not what I want).
Mar 23, 2014 at 8:16 PM
Never mind. I found another way by implementing a new AppServer class and overriding the Start method (and not calling the Base.Start), but then start a thread that will poll a directory for files.

Thank you for replying. After digging into the code I saw that is wasn't possible to configure a custom SocketServerFactory.
Mar 24, 2014 at 3:14 AM
I know you now.

But you can read the content of the files at first and then send them by socket to the socket server.

Some SuperSocket's test code works on this way.