Re: Socket

From: Feroze [msft] (ferozed_at_online.microsoft.com)
Date: 10/07/04


Date: Wed, 6 Oct 2004 18:27:41 -0700

It depends on what protocol you are using. If it is TCP, then you are out of
luck. When you disconnect, TCP detects that the connection was broken. The
socket will go into a disconnected state, and you will have to reconnect
again.

-- 
feroze
-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.
See http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------
"Wally" <valter@nospamcambieri.it> wrote in message
news:ZQQ2d.341818$5D1.15260459@news4.tin.it...
> 1 Dim bConnectionLost as Boolean
>  2 Dim bMsg(10000) As Byte
>  3 Dim sPingChar as String=Chr(0)
>  4 Do
>  5   Try
>  6     bMsg = System.Text.Encoding.UTF8.GetBytes(sPingChar.ToCharArray)
>  7     pobjSocket.Send(bMsg, bMsg.Length, SocketFlags.None)
>  8     bConnectionLost=False
>  9   Catch ex As Exception
> 10     bConnectionLost = True
> 11   End Try
> 12 Loop Until Not bConnectionLost
> 13 ...
>
> - When network cable is connected bConnectionLost is set to False, no
> exceptions and the flow works fine.
> - If I disconnext cable flow loops into DO / LOOP UNTIL of course.
> - When I reconnect cable, bConnectionLost doesn't change to False again so
> flow doesn't exit from DO / LOOP UNTIL
>
>
> "Supra" <supra56@rogers.com> ha scritto nel messaggio
> news:bfH2d.4847$1Ko.4318@news04.bloor.is.net.cable.rogers.com...
> > i know how to do this. i used to sent pong to server when server pinged
> > me. i used to do irc chat similar to mirc.  first u ( as server) must
> > send command  "PING" to client every  30 second (it is up to u to send
> > ping  more than 30 seconds). Now on client side when client recived
> > PING's command from server ....the client automatically sent  command
> > "PONG"  to server. Now if server don't received command "PONG" from
> > client, then server can disconnected to client or close socket for
> > client. this is how it works. u will have to write code for urself.
> > regards
> >
> > Wally wrote:
> >
> > >Hallo
> > >Is there anybody able to tell me if and how to restore a lost socket
> > >communication?
> > >I try to explain.
> > >Computer A and computer B are net connected and they estabilished a
> socket
> > >connection. A (which acts as a  server) is waiting for data from B and,
> > >while waiting, it sends a "ping" character to B, in order to verify is
> the
> > >connection is active.
> > >Desconnecting the net cable, the "ping" character sending generates an
> > >exception, as you can rightly presume that to connetion is no more
> active.
> > >So far so good.
> > >The problem is that re-connecting the net cable, the "ping" character
> > >sending generates the same exception, just as if the lost communication
> > >couldn't be recuperated unless you do a new call. Any idea or
suggestion?
> > >
> > >Thanks anyhow.
> > >
> > >VV
> > >
> > >
> > >
> > >
> >
>
>


Relevant Pages

  • Re: .Net Scalability problem
    ... LoadRunner will peak out a server with a few virtual users. ... To get an idea of load, ... Fire off the test client and watch the number of ... > So I think that the MTC generate concurrent connection and per ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection lost at same time every hour (sometimes)
    ... After making the two following alterations on the server the problem seems ... After analyze your ipconfig on SBS and client, ... Then, other connection is good, ...
    (microsoft.public.windows.server.sbs)
  • Re: server disconnection - very often
    ... Reason of permanent popups is VMware server aplication on clients. ... Run CEICW to configure the network of SBS: ... Two network adapters - manual router connection to broadband ... Uninstall VMware on client. ...
    (microsoft.public.windows.server.sbs)
  • Re: Lan setup 2 nic
    ... The external nic only has TCP/IP enabled. ... Ipconfig of the server is looking good, but the client is still missing the ... > connection so we have a 2 nic with router setup now. ...
    (microsoft.public.windows.server.sbs)
  • Re: Regular disconnections from remote web workplace
    ... I can connect to office server and all office clients from home at all times ... be physically working right up until the connection is lost. ... If I enter http://companyip from a client I receive the login screen for the ... Click Services tab and select Hide All Microsoft Services and Disable ...
    (microsoft.public.windows.server.sbs)

Quantcast