private static void RecieveCallback(IAsyncResult result) { try { int length = myStream.EndRead(result); if (length <= 0) { return; } byte[] newBytes = new byte[length]; Array.Copy(recBuffer, newBytes, length); ClientHandleData.HandleData(newBytes); myStream.BeginRead(recBuffer, 0, 4096 * 2, RecieveCallback, null); } catch (Exception) { return; } }
public static void InitializeClient() { ClientHandleData.InitializePackets(); ClientTCP.InitializingNetworking(); }