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

C#

 
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 
prasadbuddhika wrote:
while (soc.Connected)


I doubt that is going to serve the purpose that you think it is.

That doesn't validate the connection. All it tells you is that at some time in the past that it worked.

The following are probably the general run time conditions that one faces with sockets.
1. It fails to connect at all. Reasons: Wrong address, port, firewall rules or the server is down.
2. It runs
3. The server disconnects gracefully. Receive() will return zero.
4. The server takes too long. Reason: Server is locked up.
5. The server never responds. Reasons: Someone kicked out the power plug or the firewall dropped the connection.

Notice that in 4/5 no exception occurs. You can get an exception to occur by setting a time out value. That tells you that it hasn't sent data but not why.
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 
GeneralRe: How to add both x86 and x64 class library to the references in the project Pin
RobCroll1-Feb-11 12:34
RobCroll1-Feb-11 12:34 
GeneralRe: How to add both x86 and x64 class library to the references in the project Pin
Chesnokov Yuriy1-Feb-11 18:53
professionalChesnokov Yuriy1-Feb-11 18:53 

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.