C# TCP Application deadlocks on one computer and never deadlocks on another -
i'm not sure how approach this. hesitant showing code because it's university assignment. need place start.
i'm making tcp card game 4 players , server. every 100ms, player asks update server using background worker. server accepts client connection , reads in enumeration value (sent int32) tells action wants server send (update, card, player, etc) , value read in based on enumeration value (recieving update enumeration means needs read in int32 next). server sends response based on enumeration read in.
here's problem occurs. have custom built computer (2500k processor, win8 x64) , when execute program on it, loop forever, accepting client requests , sending appropriate response back. expected! however, on laptop (levono yogapad, win8 x64) , forth exchange lasts around 30-50 requests , deadlocks. it's @ same spot. server has read in enumeration , awaiting second value. client past part of sending enum , value , waiting results. stable on desktop , deadlocks on laptop. slow program down update every second , still deadlocks. i'm not sure do.
i've built program on each computer. i've built program on desktop , ran on laptop , still deadlocks. have suggestions?
many thanks!
you lucky code hangs on 1 machine before send assignment in , hangs on teachers machine. lucky problem reproducible, better find out hangs. without having access code have following wild guesses:
- you forgot proper error handling in places , busy loops because of unexpected error
- it hangs inside read try read n bytes peer sends
k<n
bytes
these wild guesses, without having access basic structure of program cannot expect more.
Comments
Post a Comment