Click here to Skip to main content
15,886,067 members
Home / Discussions / C#
   

C#

 
GeneralRe: I've programmed Myself Into A Corner Pin
Roger Wright2-Feb-11 14:33
professionalRoger Wright2-Feb-11 14:33 
GeneralRe: I've programmed Myself Into A Corner Pin
OriginalGriff2-Feb-11 21:17
mveOriginalGriff2-Feb-11 21:17 
GeneralRe: I've programmed Myself Into A Corner Pin
PIEBALDconsult2-Feb-11 13:21
mvePIEBALDconsult2-Feb-11 13:21 
QuestionGraph schedule for hotel menagment system Pin
nighttrain_1-Feb-11 12:08
nighttrain_1-Feb-11 12:08 
AnswerRe: Graph schedule for hotel menagment system Pin
RobCroll1-Feb-11 12:28
RobCroll1-Feb-11 12:28 
GeneralRe: Graph schedule for hotel menagment system [modified] Pin
nighttrain_1-Feb-11 12:36
nighttrain_1-Feb-11 12:36 
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 

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.