Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
Enhancing samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajuric committed Jan 1, 2018
1 parent c88c321 commit aa64e23
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Samples/ClientJs/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using SampleBase;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -60,6 +61,7 @@ static void Main(string[] args)
});

Console.Write("{0} ", nameof(ClientJs));
Process.Start(new ProcessStartInfo(Path.GetFullPath("./Site/Index.html")) { UseShellExecute= true });
AppExit.WaitFor(cts, t);
}
}
Expand Down
1 change: 1 addition & 0 deletions Samples/ClientJs/Site/Index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<title>Client JS</title>
<script src="LocalAPI.js"></script>
</head>

Expand Down
2 changes: 2 additions & 0 deletions Samples/MultiService/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using SampleBase;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using WebSocketRPC;
Expand Down Expand Up @@ -66,6 +67,7 @@ static void Main(string[] args)
});

Console.Write("{0} ", nameof(MultiService));
Process.Start(new ProcessStartInfo(Path.GetFullPath("./Site/Index.html")) { UseShellExecute = true });
AppExit.WaitFor(cts, t);
}
}
Expand Down
1 change: 1 addition & 0 deletions Samples/MultiService/Site/Index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<title>Multi service</title>
<script src="NumericService.js"></script>
<script src="TextService.js"></script>
</head>
Expand Down
1 change: 0 additions & 1 deletion Samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ The recommendation is to run samples in the following order (from the more simpl
*Server has reporting service initiatted and stopped on the client's request.*

**Remarks**
+ If a sample contains JavaScript client, open the corresponding *'Index.html'*.
+ Samples that contain multiple executables have *'Run.bat'* for one-click run.
2 changes: 2 additions & 0 deletions Samples/RawMsgJs/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using SampleBase;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -46,6 +47,7 @@ static void Main(string[] args)
});

Console.Write("{0} ", nameof(RawMsgJs));
Process.Start(new ProcessStartInfo(Path.GetFullPath("./Site/Index.html")) { UseShellExecute = true });
AppExit.WaitFor(cts, t);
}
}
Expand Down
1 change: 1 addition & 0 deletions Samples/RawMsgJs/Site/Index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<title>Raw messaging</title>
<script src="MessagingAPI.js"></script>
</head>

Expand Down
2 changes: 2 additions & 0 deletions Samples/Serialization/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using WebSocketRPC;
using System.Runtime.CompilerServices;
using SampleBase;
using System.Diagnostics;

namespace Serialization
{
Expand Down Expand Up @@ -89,6 +90,7 @@ static void Main(string[] args)
var t = Server.ListenAsync("http://localhost:8001/", cts.Token, (c, ws) => c.Bind(new ImageProcessingAPI()));

Console.Write("{0} ", nameof(Serialization));
Process.Start(new ProcessStartInfo(Path.GetFullPath("../../Site/Index.html")) { UseShellExecute = true });
AppExit.WaitFor(cts, t);
}
}
Expand Down
1 change: 1 addition & 0 deletions Samples/Serialization/Site/Index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<title>Serialization</title>
<script src="ImageProcessingAPI.js"></script>
</head>

Expand Down
15 changes: 10 additions & 5 deletions Samples/ServerClientSample/Run.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set serverApp = "Server\bin\Server.exe"
set clientApp = "Client\bin\Client.exe"
set currPath="%cd%
set serverPath="%cd%\Server\bin\net47"
set clientPath="%cd%\Client\bin\net47"

if NOT EXIST %serverApp% (
echo Build 'Server' project first.
Expand All @@ -11,6 +12,10 @@ if NOT EXIST %clientApp% (
goto :eof
)

start %serverApp%
timeout 1>nul
start %clientApp%
cd %serverPath%
start Server.exe
timeout /T 1 > nul
cd %clientPath%
start Client.exe

cd %currPath%
4 changes: 4 additions & 0 deletions Source/WebSocketRPC.Base/Invokers/RemoteInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void Dispose()
}
}

#region Static

static HashSet<Type> verifiedTypes = new HashSet<Type>();

static void verifyType()
Expand All @@ -88,6 +90,8 @@ static void verifyType()
throw new NotSupportedException($"The interface '{typeof(TInterface).Name}' must not declare any properties: { String.Join(", ", propertyList.Select(x => x.Name)) }.");
}

#endregion

Func<Request, Task> sendAsync;
ConcurrentDictionary<string, RpcWaiter> runningMethods;

Expand Down
2 changes: 2 additions & 0 deletions Source/WebSocketRPC.JS/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
2 changes: 2 additions & 0 deletions Source/WebsocketRPC.Standalone/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
2 changes: 2 additions & 0 deletions Source/WebsocketRPC.Standalone/ClassDiagram2.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
2 changes: 2 additions & 0 deletions Source/WebsocketRPC.Standalone/ClassDiagram3.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
2 changes: 2 additions & 0 deletions Source/WebsocketRPC.Standalone/ClassDiagram4.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />

0 comments on commit aa64e23

Please sign in to comment.