Skip to content
C# JavaScript CSS ASP
Latest commit 1e410b7 Jun 3, 2014 @jgauffin Replacement notice
Failed to load latest commit information.
Source
nuget
.gitignore Fixed some issues May 29, 2013
license.txt Added license May 4, 2012
readme.md Replacement notice Jun 3, 2014

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.