Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
GeneralRe: Graph schedule for hotel menagment system Pin
RobCroll1-Feb-11 12:46
RobCroll1-Feb-11 12:46 
QuestionProblem with socket.recieve() , when the clent disconnect Pin
prasadbuddhika1-Feb-11 6:32
prasadbuddhika1-Feb-11 6:32 
in my application once a client connected i run the following code

byte[] buffer = new byte[512];
       while (soc.Connected)
       {
           try
           {
               soc.Receive(buffer);
               string encodedstr = Encoding.UTF8.GetString(buffer);
               this.Invoke(update, new object[] { encodedstr });
               buffer.Initialize();
           }
           catch (Exception)
           {
               if ((soc != null) && (soc.Connected))
               {
                   soc.Disconnect(false);
               }
           }
       }


but when the client disconnected by closing or accidentally the server runs infinite loop with the
last content sent by the client. so my textbox infinitely append the last data to it's content.

so i want to know if ther is any other better way of receiving data from client continuously to solve this problem.
AnswerRe: Problem with socket.recieve() , when the clent disconnect Pin
jschell1-Feb-11 10:34
jschell1-Feb-11 10:34 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
Ennis Ray Lynch, Jr.1-Feb-11 10:57
Ennis Ray Lynch, Jr.1-Feb-11 10:57 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
jschell1-Feb-11 13:59
jschell1-Feb-11 13:59 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
Ennis Ray Lynch, Jr.1-Feb-11 15:11
Ennis Ray Lynch, Jr.1-Feb-11 15:11 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
jschell2-Feb-11 8:10
jschell2-Feb-11 8:10 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
Ennis Ray Lynch, Jr.2-Feb-11 9:32
Ennis Ray Lynch, Jr.2-Feb-11 9:32 
GeneralRe: Problem with socket.recieve() , when the clent disconnect Pin
jschell3-Feb-11 9:28
jschell3-Feb-11 9:28 
AnswerRe: Problem with socket.recieve() , when the clent disconnect Pin
jschell1-Feb-11 14:13
jschell1-Feb-11 14:13 
Questionoverloading Console.write() [modified] Pin
KARFER1-Feb-11 5:03
KARFER1-Feb-11 5:03 
AnswerRe: overloading Console.write() Pin
Pete O'Hanlon1-Feb-11 5:06
mvePete O'Hanlon1-Feb-11 5:06 
GeneralRe: overloading Console.write() Pin
KARFER1-Feb-11 5:11
KARFER1-Feb-11 5:11 
GeneralRe: overloading Console.write() Pin
Pete O'Hanlon1-Feb-11 5:12
mvePete O'Hanlon1-Feb-11 5:12 
AnswerRe: overloading Console.write() Pin
Not Active1-Feb-11 5:48
mentorNot Active1-Feb-11 5:48 
QuestionRe: overloading Console.write() Pin
TheGreatAndPowerfulOz1-Feb-11 7:13
TheGreatAndPowerfulOz1-Feb-11 7:13 
AnswerRe: overloading Console.write() Pin
Eddy Vluggen1-Feb-11 7:34
professionalEddy Vluggen1-Feb-11 7:34 
JokeRe: overloading Console.write() Pin
fjdiewornncalwe1-Feb-11 8:20
professionalfjdiewornncalwe1-Feb-11 8:20 
GeneralRe: overloading Console.write() Pin
Eddy Vluggen1-Feb-11 8:37
professionalEddy Vluggen1-Feb-11 8:37 
AnswerRe: overloading Console.write() Pin
Luc Pattyn1-Feb-11 8:44
sitebuilderLuc Pattyn1-Feb-11 8:44 
GeneralRe: overloading Console.write() Pin
Henry Minute1-Feb-11 11:16
Henry Minute1-Feb-11 11:16 
GeneralRe: overloading Console.write() Pin
Eddy Vluggen1-Feb-11 20:28
professionalEddy Vluggen1-Feb-11 20:28 
QuestionUsing virtual mode list view to monitor events queue? Pin
Chesnokov Yuriy1-Feb-11 3:47
professionalChesnokov Yuriy1-Feb-11 3:47 
QuestionHow to add both x86 and x64 class library to the references in the project Pin
Chesnokov Yuriy1-Feb-11 3:06
professionalChesnokov Yuriy1-Feb-11 3:06 
AnswerRe: How to add both x86 and x64 class library to the references in the project Pin
Pete O'Hanlon1-Feb-11 3:57
mvePete O'Hanlon1-Feb-11 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.