Skip to content

Commit

Permalink
Merge branch 'spike-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gozde committed Dec 13, 2011
2 parents e0bc587 + 054af1a commit 51734c8
Show file tree
Hide file tree
Showing 22 changed files with 1,215 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -2,6 +2,9 @@ clrzmq.userprefs
obj
bin
!/bin
/packages
nuget.exe
lib/**/libzmq.dll
*.pidb
*.suo
_ReSharper.*
Expand Down
Binary file added bin/nuget/nuget-bootstrap.exe
Binary file not shown.
19 changes: 19 additions & 0 deletions clrzmq.5.1.ReSharper
Expand Up @@ -390,6 +390,25 @@
<ExtraRule Prefix="" Suffix="" Style="AA_BB" />
</PredefinedRule>
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
<UserRule Inspect="True" Prefix="" Suffix="" Style="AaBb" StaticnessKind="Static, Instance" AccessRight="Private, Protected, ProtectedInternal, Internal, Public" Description="">
<ElementKinds>
<Kind Name="CLASS" />
<Kind Name="Machine.Specifications_Behavior" />
<Kind Name="Machine.Specifications_Context" />
<Kind Name="Machine.Specifications_ContextBase" />
<Kind Name="Machine.Specifications_Specification" />
<Kind Name="Machine.Specifications_SupportingField" />
<Kind Name="Machine.Specifications_Constant" />
</ElementKinds>
<ExtraRule Prefix="" Suffix="" Style="aa_bb" />
</UserRule>
<UserRule Inspect="True" Prefix="" Suffix="" Style="aaBb" StaticnessKind="Static, Instance" AccessRight="Private, Protected, ProtectedInternal, Internal, Public" Description="">
<ElementKinds>
<Kind Name="Machine.Specifications_Field" />
<Kind Name="Machine.Specifications_Local" />
</ElementKinds>
<ExtraRule Prefix="" Suffix="" Style="AaBb" />
</UserRule>
<Abbreviation Text="MQ" />
<Abbreviation Text="ZMQ" />
<Abbreviation Text="IO" />
Expand Down
59 changes: 39 additions & 20 deletions clrzmq.sln
Expand Up @@ -34,6 +34,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncReturn", "tests\AsyncR
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkerPool", "tests\WorkerPool\WorkerPool.csproj", "{45D99DFA-FB55-4765-BB8B-B05C69D431E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AcceptanceTests", "tests\AcceptanceTests\AcceptanceTests.csproj", "{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
POSIX_DEBUG|x64 = POSIX_DEBUG|x64
Expand Down Expand Up @@ -126,67 +128,84 @@ Global
{FE6D6CDD-8A04-4A3A-A654-5C687AB724E3}.WIN_RELEASE|x64.Build.0 = WIN_RELEASE|x64
{FE6D6CDD-8A04-4A3A-A654-5C687AB724E3}.WIN_RELEASE|x86.ActiveCfg = WIN_RELEASE|x86
{FE6D6CDD-8A04-4A3A-A654-5C687AB724E3}.WIN_RELEASE|x86.Build.0 = WIN_RELEASE|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x64.ActiveCfg = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x64.Build.0 = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x86.ActiveCfg = Release|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x86.Build.0 = Release|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x64.ActiveCfg = Debug|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x64.Build.0 = Debug|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x86.ActiveCfg = Debug|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_DEBUG|x86.Build.0 = Debug|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_RELEASE|x64.ActiveCfg = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_RELEASE|x64.Build.0 = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_RELEASE|x86.ActiveCfg = Release|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.POSIX_RELEASE|x86.Build.0 = Release|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x64.ActiveCfg = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x64.Build.0 = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x64.ActiveCfg = Debug|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x64.Build.0 = Debug|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x86.ActiveCfg = Debug|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_DEBUG|x86.Build.0 = Debug|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_RELEASE|x64.ActiveCfg = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_RELEASE|x64.Build.0 = Release|x64
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_RELEASE|x86.ActiveCfg = Release|x86
{7203CF55-A452-407E-B767-4AA7BA616794}.WIN_RELEASE|x86.Build.0 = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x64.ActiveCfg = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x64.Build.0 = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x86.ActiveCfg = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x86.Build.0 = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x64.ActiveCfg = Debug|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x64.Build.0 = Debug|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x86.ActiveCfg = Debug|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_DEBUG|x86.Build.0 = Debug|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_RELEASE|x64.ActiveCfg = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_RELEASE|x64.Build.0 = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_RELEASE|x86.ActiveCfg = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.POSIX_RELEASE|x86.Build.0 = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x64.ActiveCfg = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x64.Build.0 = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x64.ActiveCfg = Debug|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x64.Build.0 = Debug|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x86.ActiveCfg = Debug|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_DEBUG|x86.Build.0 = Debug|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_RELEASE|x64.ActiveCfg = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_RELEASE|x64.Build.0 = Release|x64
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_RELEASE|x86.ActiveCfg = Release|x86
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93}.WIN_RELEASE|x86.Build.0 = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x64.ActiveCfg = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x64.Build.0 = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x86.ActiveCfg = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x86.Build.0 = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x64.ActiveCfg = Debug|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x64.Build.0 = Debug|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x86.ActiveCfg = Debug|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_DEBUG|x86.Build.0 = Debug|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_RELEASE|x64.ActiveCfg = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_RELEASE|x64.Build.0 = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_RELEASE|x86.ActiveCfg = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.POSIX_RELEASE|x86.Build.0 = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x64.ActiveCfg = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x64.Build.0 = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x64.ActiveCfg = Debug|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x64.Build.0 = Debug|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x86.ActiveCfg = Debug|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_DEBUG|x86.Build.0 = Debug|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_RELEASE|x64.ActiveCfg = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_RELEASE|x64.Build.0 = Release|x64
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_RELEASE|x86.ActiveCfg = Release|x86
{45D99DFA-FB55-4765-BB8B-B05C69D431E7}.WIN_RELEASE|x86.Build.0 = Release|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_DEBUG|x64.ActiveCfg = POSIX_DEBUG|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_DEBUG|x64.Build.0 = POSIX_DEBUG|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_DEBUG|x86.ActiveCfg = POSIX_DEBUG|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_DEBUG|x86.Build.0 = POSIX_DEBUG|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_RELEASE|x64.ActiveCfg = POSIX_RELEASE|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_RELEASE|x64.Build.0 = POSIX_RELEASE|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_RELEASE|x86.ActiveCfg = POSIX_RELEASE|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.POSIX_RELEASE|x86.Build.0 = POSIX_RELEASE|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_DEBUG|x64.ActiveCfg = WIN_DEBUG|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_DEBUG|x64.Build.0 = WIN_DEBUG|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_DEBUG|x86.ActiveCfg = WIN_DEBUG|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_DEBUG|x86.Build.0 = WIN_DEBUG|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_RELEASE|x64.ActiveCfg = WIN_RELEASE|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_RELEASE|x64.Build.0 = WIN_RELEASE|x64
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_RELEASE|x86.ActiveCfg = WIN_RELEASE|x86
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6}.WIN_RELEASE|x86.Build.0 = WIN_RELEASE|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FE6D6CDD-8A04-4A3A-A654-5C687AB724E3} = {30C08BF9-B591-4038-A54E-2D6D70F6EAB7}
{7203CF55-A452-407E-B767-4AA7BA616794} = {30C08BF9-B591-4038-A54E-2D6D70F6EAB7}
{E30D3D43-99B4-48ED-B060-56D88C77CCD0} = {137A2F03-0D94-40F2-ADC7-3C194B143A78}
{CB79FF77-F94F-4E4B-A860-7BF941EAA2B6} = {137A2F03-0D94-40F2-ADC7-3C194B143A78}
{35C65BA4-86AF-43AE-9159-5CEE9D27C51D} = {137A2F03-0D94-40F2-ADC7-3C194B143A78}
{0AF25616-C9CB-4137-B281-2100161A610C} = {137A2F03-0D94-40F2-ADC7-3C194B143A78}
{FE6D6CDD-8A04-4A3A-A654-5C687AB724E3} = {30C08BF9-B591-4038-A54E-2D6D70F6EAB7}
{7203CF55-A452-407E-B767-4AA7BA616794} = {30C08BF9-B591-4038-A54E-2D6D70F6EAB7}
{B06D0C3B-37E4-49E8-986A-ABE2DC6A2A93} = {FED23C0F-5417-4B04-BCF3-B18DDDCF15E9}
{45D99DFA-FB55-4765-BB8B-B05C69D431E7} = {FED23C0F-5417-4B04-BCF3-B18DDDCF15E9}
{7B12A63E-EC15-4F13-A91C-C03C7E97D8B6} = {FED23C0F-5417-4B04-BCF3-B18DDDCF15E9}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = clrzmq\clrzmq.csproj
Expand Down
2 changes: 2 additions & 0 deletions lib/x64/what_to_put_here.txt
@@ -0,0 +1,2 @@
64-bit libzmq library:
- libzmq.dll
2 changes: 2 additions & 0 deletions lib/x86/what_to_put_here.txt
@@ -0,0 +1,2 @@
32-bit libzmq library:
- libzmq.dll
23 changes: 23 additions & 0 deletions nuget.cmd
@@ -0,0 +1,23 @@
@echo off
setlocal

set NUGET_EXE=bin\nuget\nuget.exe
set NUGET_BOOTSTRAPPER_EXE=bin\nuget\nuget-bootstrap.exe
set PACKAGE_DIR=packages

if not exist %NUGET_EXE% (goto bootstrap) else (goto install)

:bootstrap
%NUGET_BOOTSTRAPPER_EXE%
move %NUGET_BOOTSTRAPPER_EXE% %NUGET_EXE%
move %NUGET_BOOTSTRAPPER_EXE%.old %NUGET_BOOTSTRAPPER_EXE%

:install
%NUGET_EXE% update -self
for /F %%C in ('dir /b /s packages.config') do %NUGET_EXE% install %%C -o %PACKAGE_DIR%

:update
for /F %%C in ('dir /b /s packages.config') do %NUGET_EXE% update %%C -RepositoryPath %PACKAGE_DIR%

endlocal
if errorlevel 1 pause else exit
13 changes: 13 additions & 0 deletions nuget.sh
@@ -0,0 +1,13 @@
#!/bin/sh

NUGET_EXE=bin/nuget/nuget.exe
NUGET_BOOTSTRAPPER_EXE=bin/nuget/nuget-bootstrap.exe
PACKAGE_DIR=packages

if [ ! -e $NUGET_EXE ]; then
mono --runtime=v4.0 $NUGET_BOOTSTRAPPER_EXE
mv $NUGET_BOOTSTRAPPER_EXE $NUGET_EXE
mv ${NUGET_BOOTSTRAPPER_EXE}.old $NUGET_BOOTSTRAPPER_EXE
fi

find . -name 'packages.config' -exec mono --runtime=v4.0 $NUGET_EXE install '{}' -o $PACKAGE_DIR \;
1 change: 0 additions & 1 deletion src/clrzmq-ext/clrzmq-ext.csproj
Expand Up @@ -75,7 +75,6 @@
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
Expand Down
37 changes: 31 additions & 6 deletions src/clrzmq/Socket.cs
Expand Up @@ -486,7 +486,7 @@ public class Socket : IDisposable {
C.zmq_msg_close(_msg);
break;
}
if (C.zmq_errno() == 4) {
if (C.zmq_errno() == (int)ERRNOS.EINTR) {
continue;
}
if (C.zmq_errno() != (int)ERRNOS.EAGAIN) {
Expand Down Expand Up @@ -606,26 +606,50 @@ public class Socket : IDisposable {
/// <returns>Queue of message parts</returns>
/// <exception cref="ZMQ.Exception">ZMQ Exception</exception>
public Queue<byte[]> RecvAll() {
return RecvAll(SendRecvOpt.NONE);
return RecvAll((Queue<byte[]>)null);
}

/// <summary>
/// Listen for message, retrieving all pending message parts
/// </summary>
/// <param name="messages">The queue object to put the message into</param>
/// <returns>Queue of message parts</returns>
/// <exception cref="ZMQ.Exception">ZMQ Exception</exception>
public Queue<byte[]> RecvAll(Queue<byte[]> messages) {
if (messages == null) {
messages = new Queue<byte[]>();
}

messages.Enqueue(Recv());
while (RcvMore) {
messages.Enqueue(Recv());
}
return messages;
}

/// <summary>
/// DO NOT USE. Left in for backward compatibility, but SendRecvOpt flags are
/// not compatible with RecvAll.
/// Listen for message, retrieving all pending message parts.
/// </summary>
/// <param name="flags">Receive options</param>
/// <returns>Queue of message parts</returns>
/// <exception cref="ZMQ.Exception">ZMQ Exception</exception>
[Obsolete("Will be removed in version 3.x.")]
public Queue<byte[]> RecvAll(params SendRecvOpt[] flags) {
return RecvAll((Queue<byte[]>)null, flags);
}

/// <summary>
/// Listen for message, retrieving all pending message parts
/// DO NOT USE. Left in for backward compatibility, but SendRecvOpt flags are
/// not compatible with RecvAll.
/// Listen for message, retrieving all pending message parts.
/// </summary>
/// <param name="messages">The queue object to put the message into</param>
/// <param name="flags">Receive options</param>
/// <returns>Queue of message parts</returns>
/// <exception cref="ZMQ.Exception">ZMQ Exception</exception>
[Obsolete("Will be removed in version 3.x.")]
public Queue<byte[]> RecvAll(Queue<byte[]> messages, params SendRecvOpt[] flags) {
if (messages == null) {
messages = new Queue<byte[]>();
Expand Down Expand Up @@ -654,14 +678,15 @@ public class Socket : IDisposable {
}

/// <summary>
/// Listen for message, retrieving all pending message parts. DO NOT
/// USE, left for backwards compatibility reasons but the sendrecvopts
/// are not compatible with receiving all messages.
/// DO NOT USE. Left in for backward compatibility, but SendRecvOpt flags are
/// not compatible with RecvAll.
/// Listen for message, retrieving all pending message parts.
/// </summary>
/// <param name="encoding">String Encoding</param>
/// <param name="flags">Socket options to use when receiving</param>
/// <returns>Queue of message parts</returns>
/// <exception cref="ZMQ.Exception">ZMQ Exception</exception>
[Obsolete("Will be removed in version 3.x.")]
public Queue<string> RecvAll(Encoding encoding, params SendRecvOpt[] flags) {
var messages = new Queue<string>();
messages.Enqueue(Recv(encoding, flags));
Expand Down

0 comments on commit 51734c8

Please sign in to comment.