Threading help


hi,
(i hope question not long lol)

working on xna game uses lot of .net classes it. game has server program , client program. server receives data processes , sends (for example client ask of player positions in game e.g. x , y positions , when client asks server replies required information). coding local area network fine > 1 ms response time if test game on internet 60 ms client lag badly (not internet lag frame per second lag). reason of because when client asks server information client freezes (the whole program pauses) until gets needed information.

have never worked threads before. use threading multi-threaded server (for multiple connections) got off internet , modified lot.

want know how make "background" thread (if called), can code runs, , if code pauses wait sort of reply not pause whole program, thread. (if can figure out how use network programming).

if helps use tcplistener , tcpclient network connections. don't think matters. matters how stop lines of code pausing whole program until line of code completed (if makes sence...) i.e using threads not know how make.

hope can help.
thanks! xanather.
take @ site: http://www.xanather.com

hi

is 1 looking for?

 

 thread thread = new thread(new threadstart(() => request(100, displayscore))) { isbackground = true };  thread.start();     public void request(int userid, action<user> callback)   {    //once finish details //for example    callback(new user { score = 500 });   }    void displayscore(user user)   {    }


 


if post answers question, please click "mark answer". if post helpful please click "mark helpful".


Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'