-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from crypto-chassis/develop
Release
- Loading branch information
Showing
2,940 changed files
with
861 additions
and
608,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
binding/csharp/example/enable_library_logging/MainProgram.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
public class MainProgram { | ||
class MyLogger : ccapi.Logger { | ||
public override void LogMessage(string severity, string threadId, string timeISO, string fileName, string lineNumber, string message) { | ||
lock (this._myLock) { | ||
System.Console.WriteLine( | ||
string.Format("{0}: [{1}] {{{2}:{3}}} {4}{5}{6}", threadId, timeISO, fileName, lineNumber, severity, new string(' ', 8), message)); | ||
} | ||
} | ||
private readonly object _myLock = new object(); | ||
} | ||
public static void Main(string[] args) { | ||
var myLogger = new MyLogger(); | ||
ccapi.Logger.logger = myLogger; | ||
var option = new ccapi.SessionOptions(); | ||
var config = new ccapi.SessionConfigs(); | ||
var session = new ccapi.Session(option, config); | ||
var subscription = new ccapi.Subscription("okx", "BTC-USDT", "MARKET_DEPTH"); | ||
session.Subscribe(subscription); | ||
System.Threading.Thread.Sleep(10000); | ||
session.Stop(); | ||
System.Console.WriteLine("Bye"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<Configuration>Release</Configuration> | ||
<CcapiLibraryPath>to be provided in command line</CcapiLibraryPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="ccapi"> | ||
<HintPath>$(CcapiLibraryPath)</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
</Project> |
3 changes: 3 additions & 0 deletions
3
binding/csharp/example/enable_library_logging/user_specified_cmake_include.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_compile_definitions(CCAPI_ENABLE_LOG_TRACE) | ||
# usage: when generating the binding code, do cmake -DCMAKE_PROJECT_INCLUDE=<path-to-this-file> ..., see https://github.com/crypto-chassis/ccapi#non-c | ||
# see https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_INCLUDE.html |
Oops, something went wrong.