- asyncsocketserverandclient.zip
- Code
- ALAZ Library.sln
- Demos
- CertificateCreation
- Chat
- ChatClient
- ChatConsoleServer
- ChatCryptService
- ChatServiceServer
- ChatSocketService
- Echo
- EchoConsoleClient
- EchoConsoleServer
- EchoCryptService
- EchoForm
- EchoFormClient
- EchoFormClientSynch
- EchoFormServer
- EchoSocketService
- EchoWindowsServiceServer
- Readme.txt
- Source
- ALAZ.SystemEx.NetEx
- ALAZ.SystemEx.NetEx.csproj
- ALAZ.SystemEx.NetEx.csproj.user
- ALAZLibSN.snk
- bin
- Debug
- Release
- ALAZ.SystemEx.dll
- ALAZ.SystemEx.NetEx.dll
- ALAZ.SystemEx.NetEx.pdb
- ALAZ.SystemEx.pdb
- Properties
- SocketsEx
- ALAZ.SystemEx
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Net;
using System.IO;
using ALAZ.SystemEx.NetEx.SocketsEx;
using EchoSocketService;
using EchoCryptService;
namespace EchoWindowsServiceServer
{
public partial class Service1 : ServiceBase
{
private SocketServer FServer;
private OnEventDelegate FEvent;
private StreamWriter FEchoLog;
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
FEvent = new OnEventDelegate(Event);
FEchoLog = new StreamWriter(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\EchoLog.txt");
FServer = new SocketServer(CallbackThreadType.ctWorkerThread, new EchoSocketService.EchoSocketService(FEvent), DelimiterType.dtMessageTailExcludeOnReceive, Encoding.GetEncoding(1252).GetBytes("ALAZ"), 1024 * 2, 1024 * 16);
FServer.AddListener("Commom Port - 8090", new IPEndPoint(IPAddress.Any, 8090), EncryptType.etRijndael, CompressionType.ctNone, new EchoCryptService.EchoCryptService(), 50, 3);
FServer.Start();
}
protected override void OnStop()
{
FServer.Stop();
FServer.Dispose();
}
private void Event(string eventMessage)
{
lock (FEchoLog)
{
FEchoLog.Write(eventMessage);
FEchoLog.Flush();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.