1
0
Fork 0
mirror of https://github.com/rfc2822/GfxTablet synced 2025-10-03 17:49:17 +02:00
This commit is contained in:
wech71 2018-11-24 14:29:13 +01:00
parent cc4ad72661
commit 82d25349d7
9 changed files with 835 additions and 460 deletions

View file

@ -109,27 +109,11 @@ namespace GfxTabletWinDotnet
return stuff;
}
class StateObject
{
public static int BufferSize = 1024;
internal Socket workSocket;
internal byte[] buffer = new byte[1024];
void StartInjector()
{
bool ok = Win32Interop.InitializeTouchInjection(10, Win32Interop.enInitTouchInjectionModes.TOUCH_FEEDBACK_DEFAULT);
System.Diagnostics.Trace.Assert(ok);
}
void NewConnection(IAsyncResult ar)
{
Socket listenerSocket = (Socket)ar.AsyncState;
// Create the state object
StateObject state = new StateObject();
state.workSocket = (Socket)listenerSocket.EndAccept(ar);
state.workSocket.BeginReceive(state.buffer, 0, Marshal.SizeOf(typeof(Protocol.event_packet)), 0, new AsyncCallback(ReceiveCallback), state);
}
private void ReceiveCallback(IAsyncResult ar)
{
//ar.AsyncState;
}
}
}
}
}