Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C# JavaScript CSS ASP
branch: master
Failed to load latest commit information.
Source fixes
nuget Fixed server.stop()
.gitignore Fixed some issues
license.txt Added license
readme.md Replacement notice

readme.md

Griffin.Networking

Griffin.Networking has now been superseded by Griffin.Framework. It's pretty much better at everything.

Documentation

Still work in progress but the core framework should be reasonable stable.

Example HTTP listener

internal class Program
{
    public static void RunDemo()
    {
        var server = new MessagingServer(new MyHttpServiceFactory(),
                                            new MessagingServerConfiguration(new HttpMessageFactory()));
        server.Start(new IPEndPoint(IPAddress.Loopback, 8888));
    }
}

// factory
public class MyHttpServiceFactory : IServiceFactory
{
    public IServerService CreateClient(EndPoint remoteEndPoint)
    {
        return new MyHttpService();
    }
}

// and the handler
public class MyHttpService : HttpService
{
    private static readonly BufferSliceStack Stack = new BufferSliceStack(50, 32000);

    public MyHttpService()
        : base(Stack)
    {
    }

    public override void Dispose()
    {
    }

    public override void OnRequest(IRequest request)
    {
        var response = request.CreateResponse(HttpStatusCode.OK, "Welcome");

        response.Body = new MemoryStream();
        response.ContentType = "text/plain";
        var buffer = Encoding.UTF8.GetBytes("Hello world");
        response.Body.Write(buffer, 0, buffer.Length);
        response.Body.Position = 0;

        Send(response);
    }
}
Something went wrong with that request. Please try again.