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
public void sendRequest(ParamDTO message) | |
{ | |
try | |
{ | |
NetworkStream ns = clientSocket.GetStream(); | |
ns.WriteTimeout = WriteTimeOut; | |
Byte[] mb = serializeObject<RequestDictionaryMessage>(message); //PING | |
ns.Write(mb, 0, mb.Length); |
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
//JSONHelper | |
private static readonly JsonSerializerSettings _SerializerSettings = new JsonSerializerSettings() | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
public static Byte[] serializeObject<T>(T pObj) | |
{ | |
String JSON = JsonConvert.SerializeObject(pObj, typeof(T), _SerializerSettings); | |
return Encoding.Unicode.GetBytes(JSON); |
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
public class InvsRequestHandler : AbstractBaseRequestHandler, IRTRequestHandler | |
{ | |
protected override void run() | |
{ | |
try | |
{ | |
while (true) | |
{ | |
NetworkStream ns = clientSocket.GetStream(); | |
object deserialized =((IFormatter)new BinaryFormatter()).Deserialize((Stream)ns); |
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
public abstract class AbstractBaseRequestHandler : IRTRequestHandler | |
{ | |
protected int readTimeout; | |
protected int writeTimeout; | |
protected TcpClient clientSocket; | |
protected AbstractBaseRequestHandler() | |
{ | |
this.readTimeout = 20000; | |
this.writeTimeout = 5000; |
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
public void sendRequest(ParamDTO message) | |
{ | |
try | |
{ | |
NetworkStream ns = clientSocket.GetStream(); | |
ns.WriteTimeout = WriteTimeOut; | |
BinaryWriter bw = new BinaryWriter(ns); | |
MemoryStream ms = new MemoryStream(); | |
new BinaryFormatter().Serialize(memoryStream, obj); |
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
TcpClient clientSocket; | |
clientSocket = new TcpClient(); | |
try | |
{ | |
clientSocket.Connect(host, port); | |
} | |
catch (SocketException socketEx) | |
{ | |
throw new DSException("Connect-001", "Socket Exception", EXCEPTION_LEVEL.System, socketEx); | |
} |
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
pipeline { | |
agent { | |
label { | |
label 'jenkins-dotnet' | |
} | |
} | |
environment { | |
BASE_PATH = pwd(); | |
} | |
options { |
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
Basic Skill | |
* Linux Command | |
* Docker | |
Monitor จะมั 2 กลุ่ม | |
* Uptime-kuma | |
* Prometheus(Time Series DB) + Node Exporter (จัด Mwtric ตามต้องการ) >> Grafana (Visual) | |
Uptime-kuma (https://github.com/louislam/uptime-kuma) |
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
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime | |
COPY bin/Release/net6.0/publish/ /app | |
RUN apt-get update && apt-get install -y libxml2-dev | |
ENV DB2_CLI_DRIVER_INSTALL_PATH="/app/clidriver" | |
ENV LD_LIBRARY_PATH="/app/clidriver/lib:/app/clidriver/lib/libdb2.so" | |
ENV LIBPATH="/app/clidriver/lib" | |
ENV PATH=$PATH:"/app/clidriver/bin" |