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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<staticContent> | |
<remove fileExtension=".svg" /> | |
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> | |
</staticContent> | |
<rewrite> | |
<rules> | |
<rule name="wordpress" stopProcessing="true"> |
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
{ | |
"version": "1.0.0-*" | |
"description": "SampleConsole Console Application", | |
"authors": [ "lpyrz" ], | |
"tags": [ "" ], | |
"projectUrl": "", | |
"licenseUrl": "", | |
"compilationOptions": { | |
"emitEntryPoint": true |
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
{ | |
"projects": [ ".", "Src" ], | |
"sdk": { | |
"version": "1.0.0-rc1-update1" | |
} | |
} |
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
IPAddress ipAddress = ipHostInfo.AddressList[0]; | |
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 11000); | |
int bufferSize = 1024 * 2; | |
// Create a TCP/IP socket. | |
Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); | |
try | |
{ | |
listener.Bind(localEndPoint); |
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
[HostProtection(SecurityAction.LinkDemand, ExternalThreading = true)] | |
public Task<Socket> AcceptSocketAsync() | |
{ | |
return Task<Socket>.Factory.FromAsync(new Func<AsyncCallback, object, IAsyncResult>(this.BeginAcceptSocket), new Func<IAsyncResult, Socket>(this.EndAcceptSocket), (object) null); | |
} |
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
TcpListener listener = new TcpListener(IPAddress.Any, 55); | |
listener.Start(); | |
TcpClient client = await listener.AcceptTcpClientAsync(); | |
byte[] request; | |
using (NetworkStream ns = client.GetStream()) | |
{ | |
using (MemoryStream ms = new MemoryStream()) | |
{ | |
int i; | |
int bufferSize = 1024 * 2; |
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
namespace XGain | |
{ | |
public interface IServer : IDisposable | |
{ | |
event EventHandler<StartArgs> OnStart; | |
event EventHandler<MessageArgs> OnNewMessage; | |
event EventHandler<ErrorArgs> OnError; | |
Task StartSynchronously(CancellationToken token); | |
Task StartParallel(CancellationToken token, int? maxDegreeOfParallelism = null); |
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
using System; | |
namespace XGain | |
{ | |
public class ErrorArgs : EventArgs | |
{ | |
public ErrorArgs(Exception ex) | |
{ | |
Date = DateTime.Now; | |
Exception = ex; |
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
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
namespace XGain.Sockets | |
{ | |
public interface ISocket : IDisposable | |
{ | |
int BufferSize { get; } | |
bool Connected { get; } |
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
using System.Net; | |
using System.Net.Sockets; | |
namespace XGain.Sockets | |
{ | |
internal class XGainSocket : ISocket | |
{ | |
public int BufferSize => 65535; | |
public bool Connected => _socket.Connected; | |
public Socket InternalSocket => _socket; |
OlderNewer