Skip to content

Commit

Permalink
v0.9.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykang920 committed Jan 5, 2018
1 parent a5fbd8f commit 62f87c9
Show file tree
Hide file tree
Showing 90 changed files with 151 additions and 120 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.9.15 (2018-01-05)

Features:

- EventSink: Bind/Unbind methods now returns the binder token

## 0.9.14 (2017-12-19)

Features:
Expand Down
11 changes: 4 additions & 7 deletions GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// Copyright (c) 2017 Jae-jun Kang
// See the file LICENSE for details.

using System.Reflection;
using System.Reflection;

[assembly: AssemblyProduct("x2net")]
[assembly: AssemblyCopyright("Copyright © 2017 Jae-jun Kang")]
[assembly: AssemblyCopyright("Copyright © 2017, 2018 Jae-jun Kang")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif

[assembly: AssemblyVersion("0.9.14.0")]
[assembly: AssemblyFileVersion("0.9.14.0")]
[assembly: AssemblyVersion("0.9.15.0")]
[assembly: AssemblyFileVersion("0.9.15.0")]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Jae-jun Kang
Copyright (c) 2017, 2018 Jae-jun Kang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Binder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Buffer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/BufferTransform.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Case.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Cell.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Config.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/ConfigSection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/ConstsInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Coroutine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Deserializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Event.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/EventQueue.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
78 changes: 53 additions & 25 deletions src/x2net/EventSink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down Expand Up @@ -118,86 +118,114 @@ protected void EnsureNotDisposed()
}
}

public void Bind<T>(T e, Action<T> handler)
public void Bind(Binder.Token binderToken)
{
var flow = Flow;
if (Object.ReferenceEquals(flow, null))
{
return;
}
flow.Subscribe(binderToken);
}

public Binder.Token? Bind<T>(T e, Action<T> handler)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Subscribe(e, handler);
return null;
}
return flow.Subscribe(e, handler);
}

public void Bind<T>(T e, Action<T> handler, Predicate<T> predicate)
public Binder.Token? Bind<T>(T e, Action<T> handler, Predicate<T> predicate)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Subscribe(e, handler, predicate);
return null;
}
return flow.Subscribe(e, handler, predicate);
}

public void Bind<T>(T e, Func<Coroutine, T, IEnumerator> handler)
public Binder.Token? Bind<T>(T e, Func<Coroutine, T, IEnumerator> handler)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Subscribe(e, handler);
return null;
}
return flow.Subscribe(e, handler);
}

public void Bind<T>(T e, Func<Coroutine, T, IEnumerator> handler,
public Binder.Token? Bind<T>(T e, Func<Coroutine, T, IEnumerator> handler,
Predicate<T> predicate)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
return null;
}
return flow.Subscribe(e, handler, predicate);
}

public void Unbind(Binder.Token binderToken)
{
var flow = Flow;
if (Object.ReferenceEquals(flow, null))
{
flow.Subscribe(e, handler, predicate);
return;
}
flow.Unsubscribe(binderToken);
}

public void Unbind<T>(T e, Action<T> handler)
public Binder.Token? Unbind<T>(T e, Action<T> handler)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Unsubscribe(e, handler);
return null;
}
return flow.Unsubscribe(e, handler);
}

public void Unbind<T>(T e, Action<T> handler, Predicate<T> predicate)
public Binder.Token? Unbind<T>(T e, Action<T> handler, Predicate<T> predicate)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Unsubscribe(e, handler, predicate);
return null;
}
return flow.Unsubscribe(e, handler, predicate);
}

public void Unbind<T>(T e, Func<Coroutine, T, IEnumerator> handler)
public Binder.Token? Unbind<T>(T e, Func<Coroutine, T, IEnumerator> handler)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Unsubscribe(e, handler);
return null;
}
return flow.Unsubscribe(e, handler);
}

public void Unbind<T>(T e, Func<Coroutine, T, IEnumerator> handler,
public Binder.Token? Unbind<T>(T e, Func<Coroutine, T, IEnumerator> handler,
Predicate<T> predicate)
where T : Event
{
var flow = Flow;
if (flow != null)
if (Object.ReferenceEquals(flow, null))
{
flow.Unsubscribe(e, handler, predicate);
return null;
}
return flow.Unsubscribe(e, handler, predicate);
}

internal void AddBinding(Binder.Token binderToken)
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Exceptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Extensions.Array.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Extensions.Buffer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Extensions.Collections.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Extensions.Coroutine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Extensions.Event.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Fingerprint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/EventBasedFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/FrameBasedFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/MultiThreadFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/SingleThreadFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/ThreadlessFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Flows/TimeFlow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Handler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Hub.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Link.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/ClientLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/LinkSession.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/SendBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/ServerLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/SessionBasedLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/Socket/AbstractTcpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
2 changes: 1 addition & 1 deletion src/x2net/Links/Socket/AbstractTcpServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Jae-jun Kang
// Copyright (c) 2017, 2018 Jae-jun Kang
// See the file LICENSE for details.

using System;
Expand Down
Loading

0 comments on commit 62f87c9

Please sign in to comment.