Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: Web service calling business logic Pin
leppie21-Jul-08 14:49
leppie21-Jul-08 14:49 
GeneralRe: Web service calling business logic Pin
Gktony21-Jul-08 20:53
Gktony21-Jul-08 20:53 
QuestionImplementing IWebBrowser2 on WebBrowser control? Pin
Christopher Duncan21-Jul-08 6:16
Christopher Duncan21-Jul-08 6:16 
AnswerRe: Implementing IWebBrowser2 on WebBrowser control? Pin
led mike21-Jul-08 6:59
led mike21-Jul-08 6:59 
GeneralRe: Implementing IWebBrowser2 on WebBrowser control? Pin
Christopher Duncan21-Jul-08 7:12
Christopher Duncan21-Jul-08 7:12 
GeneralRe: Implementing IWebBrowser2 on WebBrowser control? Pin
led mike21-Jul-08 7:40
led mike21-Jul-08 7:40 
GeneralRe: Implementing IWebBrowser2 on WebBrowser control? Pin
Christopher Duncan21-Jul-08 8:24
Christopher Duncan21-Jul-08 8:24 
QuestionSystem.Net.Socket.Connected Pin
Jason McBurney21-Jul-08 5:58
Jason McBurney21-Jul-08 5:58 
I am porting a VB6 winsock.ocx based library to a .Net Sockets implementation, and I am not the most savvy sockets programmer. The architecture of the communication system was designed long before I got here; so changing the overall design is not an option. Moreover, this system has a low frequency of tcp traffic, so the Socket.Connected will almost always be out-of-date.

The fundamental issue is the connected property of the socket. It does not seem to be funcitonal; however, I have found others that have had similar issues http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.connected.aspx[^]

When I stepping-through the code in the debugger, unplug the network at the right moment, and view the sock object with the quick watcher, it shows me the value of sock.Connected has changed to false as expected. However, while running the code below, in debug mode but not stepping-through, the behavior of sock.Connected is different (when I unplug the wire, it does not update to false).

Thoughts?


private bool isConnected(){    
bool rVal = false;    
//an alternate way to refresh the connected status of the sock.    
try    
{        
bool blcking = sock.Blocking;        
try        
{            
byte[] junk = new byte[2];            
sock.Blocking = false;            
sock.Send(junk, 1, 0, SocketFlags.None);                                     
rVal = sock.Connected;        
}        
finally        
{            
sock.Blocking = blcking;           
}    
}    
catch (SocketException e)    
{        
rVal = e.SocketErrorCode == SocketError.WouldBlock;    
}    
return rVal;
}


You can only be young once. But you can always be immature.
- Dave Barry

AnswerRe: System.Net.Socket.Connected Pin
led mike21-Jul-08 7:16
led mike21-Jul-08 7:16 
GeneralRe: System.Net.Socket.Connected Pin
DaveyM6921-Jul-08 8:14
professionalDaveyM6921-Jul-08 8:14 
AnswerRe: System.Net.Socket.Connected Pin
nelsonpaixao21-Jul-08 13:10
nelsonpaixao21-Jul-08 13:10 
Questionstructured storage API Pin
Miss_hacker21-Jul-08 5:58
Miss_hacker21-Jul-08 5:58 
AnswerRe: structured storage API Pin
led mike21-Jul-08 6:57
led mike21-Jul-08 6:57 
GeneralRe: structured storage API Pin
Miss_hacker21-Jul-08 7:53
Miss_hacker21-Jul-08 7:53 
GeneralRe: structured storage API Pin
led mike21-Jul-08 7:59
led mike21-Jul-08 7:59 
GeneralRe: structured storage API Pin
DaveyM6921-Jul-08 8:21
professionalDaveyM6921-Jul-08 8:21 
GeneralRe: structured storage API Pin
Miss_hacker21-Jul-08 19:32
Miss_hacker21-Jul-08 19:32 
GeneralRe: structured storage API Pin
DaveyM6922-Jul-08 0:30
professionalDaveyM6922-Jul-08 0:30 
QuestionGenerating Incremental Values preceded with letters Pin
Banjo Ayorinde21-Jul-08 5:11
Banjo Ayorinde21-Jul-08 5:11 
AnswerRe: Generating Incremental Values preceded with letters Pin
Pete O'Hanlon21-Jul-08 5:41
mvePete O'Hanlon21-Jul-08 5:41 
QuestionDate Range Function Pin
Reality Strikes21-Jul-08 4:04
Reality Strikes21-Jul-08 4:04 
AnswerRe: Date Range Function Pin
paas21-Jul-08 4:52
paas21-Jul-08 4:52 
GeneralRe: Date Range Function Pin
Reality Strikes21-Jul-08 8:18
Reality Strikes21-Jul-08 8:18 
AnswerRe: Date Range Function Pin
Luc Pattyn21-Jul-08 4:52
sitebuilderLuc Pattyn21-Jul-08 4:52 
GeneralRe: Date Range Function Pin
Reality Strikes21-Jul-08 8:19
Reality Strikes21-Jul-08 8:19 

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.