강의

멘토링

커뮤니티

Inflearn Community Q&A

leesejin0506034629's profile image
leesejin0506034629

asked

[C# and Unity MMORPG Game Development Series] Part4: Game Server

SendBuffer

System.InvalidOperationException 이러한 오류가 나옵니다.

Written on

·

381

·

Edited

0

System.InvalidOperationException: 'The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true.'

 

코드를 작성했는데 이러한 오류가 나옵니다.

제가 작성한 코드에 오타를 뒤져봐도 찾을 수가 없습니다.

혹시 어떠한 경우에 이런 오류가 생기나요 100% 로 오류가 나옵니다.화면 캡처 2024-04-03 120637.png

public static ThreadLocal<SendBuffer> CurrentBuffer = new ThreadLocal<SendBuffer>( () => { return new SendBuffer(ChunkSize); }, trackAllValues: true);

 

찾아보니 스레드 로컬 커런트 버퍼를 만들 때 이렇게 해주면 오류가 사라지긴 합니다.

왜 이런 문제가 발생하는 건가요?

 

 

C#unity네트워크

Answer 1

0

죄송합니다 단순 오타였습니다. 어제는 눈 씻고 찾아봐도 안보였는데 찾았습니다.!

leesejin0506034629's profile image
leesejin0506034629

asked

Ask a question