Hi,
I write this code for send back offline message's to user who comeing online and has offline message from some other user.
here is code of server (just for send back offline message to client):
CODE
string offlinemessagepath = PathUsers + User + "\\offline-message\\";
foreach (string Friend in Directory.GetDirectories(offlinemessagepath))
{
string readofflinepath = Friend + "\\offmessage.txt";
foreach (string line in System.IO.File.ReadAllLines(readofflinepath))
{
string offline = line;
string message = "jjfnb876gtbuh2jk3fjiu78y6" + offline;
SendMsgToClient(message, socketData.m_clientNumber);
}
string delfile = Friend + "\\offmessage.txt";
File.Delete(delfile);
string deldic = Friend;
Directory.Delete(deldic);
}
as you can see i read all offline message of a user from a text file. the problem is send speed of each line .
i mean becuse code runing from a computer "SendMsgToClient" runing to fast and client can get just 3 message per seconde . so i need make some delay for client .
i did try break point and in break point mode everything is ok and no problem at all becuse i send message whit delay (i mean whit human speed)
any idea?
thanks