Skip to content

Commit

Permalink
Add readme, license and authors files.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gozde committed Dec 14, 2011
1 parent 51734c8 commit 42d3dee
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 1 deletion.
7 changes: 7 additions & 0 deletions AUTHORS
@@ -0,0 +1,7 @@
Jeffrey Dik
Martin Sustrik github.com/sustrik
Michael Compton
John Gozde github.com/jgoz
Rui Lopes github.com/rgl
Fredrik Holmstr�m github.com/fholm
ckobra github.com/ckobra
165 changes: 165 additions & 0 deletions LICENSE
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Empty file removed README
Empty file.
181 changes: 181 additions & 0 deletions README.md
@@ -0,0 +1,181 @@
# clrzmq &mdash; Official 0MQ Bindings for .NET and Mono
*(Formerly clrzmq2; legacy bindings have moved to [clrzmq-old][clrzmq-old])*

This project aims to provide the full functionality of the underlying ZeroMQ API to CLR projects. The version of libzmq currently being targeted is **2.1 (stable)**.

## Getting Started

The quickest way to get started with clrzmq is by using the [NuGet package][clrzmq-nuget-x86] ([64-bit version][clrzmq-nuget-x64]). The NuGet packages include a copy of the native libzmq.dll, which is required to use clrzmq.

You may also build clrzmq directly from the source. See the Development Environment Setup instructions below for more detail.

To get an idea of how to use clrzmq, have a look at the following example.

### Example server

```c#
using System;
using System.Text;
using System.Threading;
using ZMQ;

namespace ZMQGuide
{
class Program
{
static void Main(string[] args)
{
// ZMQ Context, server socket
using (Context context = new Context(1)
using (Socket socket = context.Socket(SocketType.REP))
{
socket.Bind("tcp://*:5555");

while (true)
{
// Wait for next request from client
string message = socket.Recv(Encoding.Unicode);
Console.WriteLine("Received request: {0}", message);

// Do Some 'work'
Thread.Sleep(1000);

// Send reply back to client
socket.Send("World", Encoding.Unicode);
}
}
}
}
}

### Example client

```c#
using System;
using System.Text;
using ZMQ;

namespace ZMQGuide
{
class Program
{
static void Main(string[] args)
{
// ZMQ Context and client socket
using (Context context = new Context(1))
using (Socket requester = context.Socket(SocketType.REQ))
{
requester.Connect("tcp://localhost:5555");

string request = "Hello";
for (int requestNum = 0; requestNum < 10; requestNum++)
{
Console.WriteLine("Sending request {0}...", requestNum);
requester.Send(request, Encoding.Unicode);

string reply = requester.Recv(Encoding.Unicode);
Console.WriteLine("Received reply {0}: {1}", requestNum, reply);
}
}
}
}
}
```

More C# examples can be found in the [0MQ Guide][zmq-guide] or in the [examples repository][zmq-example-repo]. Tutorials and API documentation specific to clrzmq are on the way.

## Development Environment

On Windows/.NET, clrzmq is developed with Visual Studio 2010. Mono development is done with MonoDevelop 2.8+.

### Windows/.NET

Before clrzmq can be used, the native `libzmq.dll` must be compiled for your target platform from [0MQ sources][libzmq-2].

#### libzmq

1. Download/clone the source from the [repository][libzmq-2] or the [ZeroMQ website][zmq-dl].
2. Open the Visual Studio solution, located in `builds/msvc/msvc.sln`.
3. Set the build configuration as necessary (e.g., Release/Win32 or WithOpenPGM/x64).
* **NOTE:** WithOpenPGM builds require the bundled OpenPGM sources to be built for Windows, the steps of which are beyond the scope of this README.
4. Build the `libzmq` project.
5. `libzmq.dll` should now be located at `/lib` in the zeromq source tree.

#### clrzmq

1. Clone the source.
2. Run `nuget.cmd`, which downloads any dependent packages (e.g., Machine.Specifications for acceptance tests).
3. Copy `libzmq.dll` from the zeromq project to the appropriate location in the clrzmq lib folder (i.e., `/lib/x86` or `/lib/x64`).
4. Run `build.cmd` to build the project and run the test suite. PGM-related tests will fail if a non-PGM build of libzmq is used.
5. The resulting binaries will be available in `/out`.

### Mono

**NOTE**: Mono 2.10.7+ is required **for development only**, as the NuGet scripts and executables require this version to be present.
If you choose to install dependencies manually, you may use any version of Mono 2.6+.

#### Mono 2.10.7+ configuration

NuGet relies on several certificates to be registered with Mono. The following is an example terminal session (on Ubuntu) for setting this up correctly.
This assumes you have already installed Mono 2.10.7 or higher.

```shell
$ mozroots --import
... typing 'yes' many, many times...

$ certmgr -ssl https://go.microsoft.com
$ certmgr -ssl https://nugetgallery.blob.core.windows.net
$ certmgr -ssl https://nuget.org
```

With any luck, this is the correct set of certificates to get NuGet working on Mono.

#### libzmq

Either clone the [ZeroMQ repository][libzmq-2] or [download the sources][zmq-dl], and then follow the build/install instructions for your platform.
Use the `--with-pgm` option if possible.

#### clrzmq

1. Clone the source.
2. Run `nuget.sh`, which downloads any dependent packages (e.g., Machine.Specifications for acceptance tests).
3. Run `build.sh` to build the project and run the test suite. PGM-related tests will fail if a non-PGM build of libzmq is used.
4. The resulting binaries will be available in `/out`.

## Issues

Issues should be logged on the [GitHub issue tracker][issues] for this project.

When reporting issues, please include the following information if possible:

* Version of clrzmq and/or how it was obtained (compiled from source, NuGet package)
* Version of libzmq being used
* Runtime environment (.NET/Mono and associated version)
* Operating system and platform (Win7/64-bit, Linux/32-bit)
* Code snippet demonstrating the failure

## Contributing

Pull requests and patches are always appreciated! To speed up the merge process, please follow the guidelines below when making a pull request:

* Create a new branch in your fork for the changes you intend to make. Working directly in master can often lead to unintended additions to the pull request later on.
* When appropriate, add to the AcceptanceTests project to cover any new functionality or defect fixes.
* Ensure all previous tests continue to pass (with exceptions for PGM tests)
* Follow the code style used in the rest of the project. ReSharper and StyleCop configurations have been included in the source tree.

Pull requests will still be accepted if some of these guidelines are not followed: changes will just take longer to merge, as the missing pieces will need to be filled in.

## License

This project is released under the [LGPL][lgpl] license, as is the native libzmq library. See LICENSE for more details as well as the [0MQ Licensing][zmq-license] page.

[clrzmq-old]: https://github.com/zeromq/clrzmq-old
[clrzmq-nuget-x86]: http://packages.nuget.org/Packages/clrzmq
[clrzmq-nuget-x64]: http://packages.nuget.org/Packages/clrzmq-x64
[libzmq-2]: https://github.com/zeromq/zeromq2-1
[zmq-guide]: http://zguide.zeromq.org/page:all
[zmq-example-repo]: https://github.com/imatix/zguide/tree/master/examples/C%23
[zmq-dl]: http://www.zeromq.org/intro:get-the-software
[zmq-license]: http://www.zeromq.org/area:licensing
[issues]: https://github.com/zeromq/clrzmq/issues
[lgpl]: http://www.gnu.org/licenses/lgpl.html
4 changes: 3 additions & 1 deletion clrzmq.sln
Expand Up @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{1C71420E-3277-4855-A266-E50593D8164D}"
ProjectSection(SolutionItems) = preProject
README = README
AUTHORS = AUTHORS
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "settings", "settings", "{F931F059-9877-4554-85E6-771DFECDFE00}"
Expand Down

0 comments on commit 42d3dee

Please sign in to comment.