Click here to Skip to main content
15,887,999 members
Home / Discussions / C#
   

C#

 
QuestionOuter border - Tablelayoutpanel Pin
anoopkamboj1-Feb-10 21:16
anoopkamboj1-Feb-10 21:16 
AnswerRe: Outer border - Tablelayoutpanel Pin
OriginalGriff1-Feb-10 23:15
mveOriginalGriff1-Feb-10 23:15 
QuestionProblem with TAPI [modified] Pin
saeidfarahi1-Feb-10 19:53
saeidfarahi1-Feb-10 19:53 
QuestionC# Server running in mono on linux Pin
justwithit1-Feb-10 19:45
justwithit1-Feb-10 19:45 
AnswerRe: C# Server running in mono on linux Pin
Migounette2-Feb-10 7:30
Migounette2-Feb-10 7:30 
GeneralRe: C# Server running in mono on linux Pin
Migounette2-Feb-10 7:31
Migounette2-Feb-10 7:31 
GeneralRe: C# Server running in mono on linux Pin
justwithit2-Feb-10 11:00
justwithit2-Feb-10 11:00 
GeneralRe: C# Server running in mono on linux Pin
Migounette4-Feb-10 6:42
Migounette4-Feb-10 6:42 
You got it.
The problem with TCP is you may have a text protocol (HTTP, ...) or binary (RDP - remote desktop...)

If your protocol is too weak you can resync, so you may have or not a control.

Send -->
<-- Ack Or Error

If you want to be sure that the message has been delivery, for instance the ftp protocol does this.

case "REST":
...
break;

default: //We Don't understand the Command
SendMsg("500 Command not understood\r\n",ref outBuffer);
break;

My advise, is read you socket buffer normaly, check at the beginning that you have a signature 0x80 (for instance), if not consume the buffer, and wait for another packet, or another option, search for the sync byte.

On heavy traffic, the tcp stack may overloaded, in this case you may have in your buffer.

First Read
0x80 xx xx xx xx 0x80

Second Read
xx xx xx xx 0x80 xx

Third Read
xx xx xx 0x80 xx xx

....

You can mark the start and the stop of your packet, start with a 0x80 and then get the size (which gives the size), you can break and split you data, and consume. Place your uncomplete packet in a waiting queue, and wait for the following one. When received, add it to the end, check that the size matches the new packet, if not drop it and resync.

A bit complex at the beginning, but I can insure that it works fine in all cases. Trust me I work in the telcom area, I know what is TCP over load... thanks to the Apple phone Smile | :)
QuestionControl Message Box Pin
satsumatable1-Feb-10 19:19
satsumatable1-Feb-10 19:19 
AnswerRe: Control Message Box Pin
Eric (eD)1-Feb-10 19:33
Eric (eD)1-Feb-10 19:33 
GeneralRe: Control Message Box Pin
satsumatable1-Feb-10 19:36
satsumatable1-Feb-10 19:36 
AnswerRe: Control Message Box Pin
V.2-Feb-10 1:03
professionalV.2-Feb-10 1:03 
QuestionLinq with Link List Pin
Khaniya1-Feb-10 19:15
professionalKhaniya1-Feb-10 19:15 
AnswerRe: Linq with Link List Pin
Calla1-Feb-10 21:32
Calla1-Feb-10 21:32 
GeneralRe: Linq with Link List Pin
Khaniya1-Feb-10 22:19
professionalKhaniya1-Feb-10 22:19 
GeneralRe: Linq with Link List Pin
Anurag Gandhi2-Feb-10 0:04
professionalAnurag Gandhi2-Feb-10 0:04 
GeneralRe: Linq with Link List Pin
Khaniya2-Feb-10 17:45
professionalKhaniya2-Feb-10 17:45 
Questionis Global variable good or bad in c#.net? Pin
vnsraj1-Feb-10 18:46
vnsraj1-Feb-10 18:46 
AnswerRe: is Global variable good or bad in c#.net? Pin
Eric (eD)1-Feb-10 19:30
Eric (eD)1-Feb-10 19:30 
GeneralRe: is Global variable good or bad in c#.net? Pin
#realJSOP1-Feb-10 23:37
mve#realJSOP1-Feb-10 23:37 
AnswerRe: is Global variable good or bad in c#.net? Pin
dojohansen1-Feb-10 23:29
dojohansen1-Feb-10 23:29 
QuestionHow to swap bounded columns to rows in datagridview Pin
VenkataRamana.Gali1-Feb-10 18:43
VenkataRamana.Gali1-Feb-10 18:43 
AnswerRe: How to swap bounded columns to rows in datagridview Pin
Anurag Gandhi1-Feb-10 20:07
professionalAnurag Gandhi1-Feb-10 20:07 
Questiondownloading file. in response: "Content-Disposition: attachment; filename="file.gif"" Pin
hello_amigo1-Feb-10 15:46
hello_amigo1-Feb-10 15:46 
AnswerRe: downloading file. in response: "Content-Disposition: attachment; filename="file.gif"" Pin
Not Active1-Feb-10 16:17
mentorNot Active1-Feb-10 16:17 

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.