Add Command Assembly

Apr 5, 2014 at 3:32 AM
Edited Apr 5, 2014 at 3:33 AM
Hello,

thanks for your good work, i got one question:

Is it possible to add a assembly for commands without configuration file?
              <commandAssemblies>
                <add assembly="BasicModules"></add>
              </commandAssemblies>
Thanks for your time
Apr 5, 2014 at 3:37 AM
Yes, there is a configuration model class was design for this purpose:
https://supersocket.codeplex.com/SourceControl/latest#SocketBase/Config/CommandAssemblyConfig.cs
Apr 5, 2014 at 4:27 AM
Thanks for your fast reply!

I'm a bit confused on how to use this exactly and could not get it working. Do you have an example?

Thanks
Apr 7, 2014 at 2:54 PM
How did you start your server? By configuration or by programming?
Apr 7, 2014 at 9:56 PM
Edited Apr 8, 2014 at 6:08 AM
Hello,

my server is started by programming. Tried several things, still could not get it working.

Shortened part of start:
        MyBase.New(New DefaultReceiveFilterFactory(Of CustomReceiveFilter, BinaryRequestInfo)())
        MyBase.Setup(New ServerConfig() With {.Port = ServerPort}, LogFactory:=New CustomLogFactory())
        MyBase.Start()
Looked through the whole SuperSocket Project, but did not find any example or any project using the CommandAssemblyConfig.cs. I'm using version 1.6.1 and really thankful for any example.

Thanks
Apr 8, 2014 at 4:56 PM
Dim serverConfig = New ServerConfig() With {.Port = ServerPort }
Dim assemblies = New List(OfType ICommandAssemblyConfig)()
assemblies.Add(New CommandAssemblyConfig() With { .Assembly = xxxx })
serverConfig.CommandAssemblies = assemblies
MyBase.Setup(serverConfig, LogFactory:=New CustomLogFactory())

https://supersocket.codeplex.com/SourceControl/latest#SocketBase/Config/ServerConfig.cs
https://supersocket.codeplex.com/SourceControl/latest#SocketBase/Config/CommandAssemblyConfig.cs


Anyway, I always prefer to start by configuration.