|
|
| Frequently Asked Questions |
- Do I have to start all the agents or just a subset?
You can start a subset of the agents, or no additional agents if you don't need their features. For instance, in a minimal WebServer configuration, only the WebServer and the HTTPFileServer agent are needed to serve static files.
- I compiled my agent and put it in the same directory as the executable. I added props for my agent to the neokernel_props.xml, but I get errors when I try to run my program that say could not create agent "myagent". What is wrong?
This error is usually the result of problems with the classname prop. Check that your compiled assembly is in the same directory as the Neokernel executable, and that the classname prop uses the same lettercase and spelling as the class you wish to load.
1. If you can't find any problems, check the syntax of your classname prop. C# agents are loaded using the following syntax in the classname prop:
<assembly_name>.<classname>
Agent classes that are compiled into a Visual Basic.NET assembly require a different syntax to load the class from the assembly:
<assembly_name>.<namespace>.<classname>
2. Also, check to be sure that the assembly you are loading is in the same directory as the neokernel.exe or in a subdirectory of the executable's directory.
3. Thirdly, check in your agent's start() method to be sure it isn't trying to use agents that haven't been started yet. For instance, if you try to register() with the ServiceManager before the ServiceManager has started, you will see an error.
4. Finally, check to be sure that there aren't any conflicting versions of your assembly lying around in the references path.
- Why can't I simply declare that my class implements the RequestHandler interface instead of inheriting from RequestAgent?
The RequestAgent class contains important features for multithreading, Web I/O, and agent collaboration.
- Will the Neokernel run my ASP.NET files?
Yes. The Neokernel uses the ASP.NET runtime built into the .NET environment to execute ASP.NET files. Only files with the .aspx extension are handled by the ASP.NET runtime. Note: If your ASP.NET file references a .dll or assembly, that .dll must be in the /bin subdirectory of the folder where your .aspx file is located. If you want to use a web.config file with ASP.NET debugging properties, put that file in the same directory as your .aspx file.
- Why can I only load assemblies from the executable directory or a subdirectory of the executable directory?
This is a restriction imposed by the .NET environment to resolve the infamous problems of dll hell.
- Why are the capitalization conventions in the Neokernel different?
This is to maintain consistency with Neokernel platforms that are implemented using other languages.
- Why would I want to change the bind_port of the WebServer? Can you give me an example of how to call your API to bind the webserver to a different port?
Changing the bind_port is useful when running on a machine that has another Web Server running on it. The bind_port determines the port that the WebServer will listen for connections on. Only one process can be listening on a given port, so if you want to run several instances of the Neokernel in parallel on a single host, you must assign each Neokernel a unique bind_port to avoid conflicts. HTTP connections are routed to port 80 by default, so if you don't specify a bind_port property the server will listen on port 80.
If you put a configuration file (neokernel_props.xml ) in the startup directory, you can specify the bind_port in the WebServer section of this file.
Alternatively, you can create a com.neokernel.props.Props containing each of the properties for the webserver and start the server programmatically from your code.
- Do I need to care about socket_linger_time?
This property is used for performance tweaking under extremely heavy server loads; usually it should remain unchanged.
- What is refuse_requests used for?
The refuse_requests prop is used by the WebServer as a blacklist;if any of the strings on this blacklist appear in any part of an incoming request, that request is dropped. This is useful if you want to block clients using a specific browser or coming from a specific IP range.
- What is the max_file_size property for?
The max_file_size property defines the maximum size (in bytes) that a log file can grow to before the server starts a fresh log file. This property is supported by agents that perform logging.
- How do I redistribute the .dll?
Install a copy of the neokernel.dll and a copy of your license with each installation of your software.
- Can I redistribute the Neokernel?
Yes, if you bought a license for redistribution then you may redistribute the Neokernel.dll with your application.
- How do I get a customized license or source code?
Please contact the sales department for a quote at sales@neokernel.com or (412) 682-5282.
- Why do I get a warning dialog when I connect to a Neokernel server that is using the localhost_cert.pfx certificate for SSL secured connections?
The localhost_cert.pfx certificate is tied to the domain name localhost. It is intended ONLY as an example; if you want to buy a production certificate for your domain name, contact the sales department.
- Where do I put my compiled DLLs when I'm running the Neokernel as a service?
The executable directory or any sub-directory of the executable directory.
- How can I connect to a database?
You can use any technique or component that you prefer. The Neokernel works with any database access method supported by the .NET framework.
- What is nkhttpd.exe?
nkhttpd.exe was the name of the executable in release 1.0 of the Neokernel. This has been changed.
- Can I put comments in my configuration files?
Yes. You can comment a line using the syntax '##'.
- I modified the WebTutorials example and now I get errors when I try to load my modified WebTutorials.dll assembly. What is going on?
Double check to be sure you deleted the extra copy of WebTutorials.dll from the Neokernel's root directory.
- I would like to run a .Net webservice within your webserver. Is this possible and if yes how?
One way to accomplish this is by using ASP.NET pages as described in this article: http://www.aspfree.com/c/a/ASP.NET/Creating-an-ASPNET-Webservice-Part-1-of-2/
The Neokernel web server passes your ASP.NET page to the ASP.NET compiler, which generates the output for the requestor.
Another way is to create ASMX/WSDL files describing your web service applications and serve these just like other static files, using the Neokernel web server. You must add the neccessary MIME types to the MIME types configuration file, for example:
xml=text/xml
asmx=text/xml
wsdl=text/xml
- How do I access the headers passed by the browser to the webserver?
The field RequestHeaders in the HTTPAgentRequest method contains the all headers in the request in one string. The following sample code will print the headers passed by the browser:
using System;
using com.neokernel.nk;
using com.neokernel.httpd;
public class HeadersPage:RequestAgent
{
public override void handleRequest(AgentRequest request)
{
string headers = (HTTPAgentRequest)request.RequestHeaders;
request.println("<HTML><P> Incoming Request Headers:"
+ headers + | |