Thanks in Advance.
I have developed one Asynchronous Socket Server in C# [Console Application]. Main functionality of this server is to communicate with Hardware. This socket server receives data from client and sends to specific device. For sending data to hardware, dll is used. 3 dll functions are imported.
[DllImport(m_strPath, CharSet = CharSet.Auto)]
public static extern int Net_Init(uint dwIP, int nIPPort, uint dwIDCode, int nTimeOut);
[DllImport(m_strPath, CharSet = CharSet.Auto)]
public static extern int Net_SendPicture(int nCardID, int nWndNo, int nPosX, int nPosY, int nCx, int nCy, IntPtr pPictureFile, int nSpeed, int nEffect, int nStayTime, int nPictRef);
[DllImport(m_strPath, CharSet = CharSet.Auto)]
public static extern int Net_SendText(int nCardID, int nWndNo, IntPtr pText, int crColor, int nFontSize, int nSpeed, int nEffect, int nStayTime, int nAlignment);
[DllImport(m_strPath, CharSet = CharSet.Auto)]
public static extern int Net_Disconnect();
When I am receiving request I am sending data to specific device. As request are multiple,
data is getting sent to other device.
For example
Thread 1 Req-1 Received
Req-1-Init Method Called for IP 2
Req-1-Sending text
Thread 2 Req-2 Received
Req-2-Init Method Called for IP 2
Req-1-Sending Picture ---------- Picture is getting sent to second hardware
Req-2-sendding Text
Req-1-Disconnect
Req-2-sending Picture
Please let me know the good approach so using Asynchronous client I can send data to hardware.
using DLL.
What I have tried:
I googled about synchronous Server but asynchronous socket server is best.