Funktioniert oder funktioniert es nicht? Was ist mit der Faszination mit dem Timeout?Aber, wenn ich die HW vom Netz trenne, dann ist die Timeout Zeit wieder unter 1 sekunde
Die Timeout Zeit wird nicht berücksichtigt.Funktioniert oder funktioniert es nicht? Was ist mit der Faszination mit dem Timeout?
public Sub ConnectToServer
Try
If AStreams.IsInitialized Then AStreams.Close
If Socket1.IsInitialized Then Socket1.Close
Dim sock As Socket
Socket1 = sock
Socket1.Initialize("Socket1")
Socket1.Connect(Variablen.IPaddress, Variablen.Port, 10000)
Wait For Socket1_Connected (Successful As Boolean)
If Successful Then
'AStreams.Initialize(Socket1.InputStream,Socket1.OutputStream,"Astreams")
Dim aStream As AsyncStreams
AStreams = aStream
AStreams.Initialize(Socket1.InputStream,Socket1.OutputStream,"Astreams")
LOGIN_QUERY(CreateMap("FName":Variablen.Vorname,"LName":Variablen.Nachname,"email":Variablen.Email,"PassW":Variablen.PWlogin))
End If
Catch
Log(LastException.Message)
MsgboxAsync(LastException.Message,"")
If AStreams.IsInitialized Then AStreams.Close
If Socket1.IsInitialized Then Socket1.Close
End Try
End Sub
It is, you just don't know how network timeouts work. BTW, I'm done with German for now, since Standard American English is a tad simpler for meDie Timeout Zeit wird nicht berücksichtigt.
You are disconnecting your hardware and you expect what? For the system to wait 10 seconds before it times out? It could, but what you did not count on is your Fritz box. It probably notices that you disconnected the cable. Smart as it is, it knows what device(s) are/were available on that port. Now if something from the outside tries to connect to those boxes, the Fritz box just hangs up the connection. No 10 second timeout, since the Fritz box knows nothing about it. On your end, the dropped connection is seen and the connection stops. Period. There is no retrying at this point. You are really killing me. Every post you seem to change the goal post and/or don't really seem to explain very well what you want. You seem to refuse or you just don't plain know how to have logs appear in Release mode and even then you seem to refuse to use Debug mode, otherwise you should be seeing the underlying Java framework complaining. In this case, it probably would have told you that the connection was refused (or something like that) which would provide you with a hint that you are not dealing with a timeout situation. If you want an actual "retry" period of 10 seconds, where you just keep trying to connect, even though connections are refused, you'll have to code your own retry logic. The network layer is not going to do it for you.Aber, wenn ich die HW vom Netz trenne
Public serverStream As NetworkStream
Public clientSocket As New System.Net.Sockets.TcpClient()
Public Sub CreateTCPConnection()
Try
clientSocket.Connect(System.Net.IPAddress.Parse(My.Settings.ServerIP), My.Settings.ServerPort)
ConnectionStatusLbl.Text = "Connection: Connected"
ConnectionStatusPB.Image = My.Resources.LED_Green
clientSocket.SendTimeout = 10000
Catch ex As Exception
ConnectionStatusLbl.Text = "Connection: Not Connected"
clientSocket.Close()
MsgBox(ex.ToString)
End Try
End Sub
does not equalclientSocket.SendTimeout = 10000
In the first case, Microsoft documents explicitly statesSocket1.Connect(Variablen.IPaddress, Variablen.Port, 10000)
Whereas AndroidThe SendTimeout property determines the amount of time that the Send method will block until it is able to return successfully
Two different things. In Android's case, the connection is refused (and yes, I'm still guessing here since you're not logging anything) and since that is an error, Android errors out. In VB's case it looks like it is retrying for you. But that is VB's implementation of a socket feature, not a "standard" socket feature.The connection will then block until established or an error occurs.
Try Catch halt gar nix an.Try Catch den Aufbau länger hält wie folgt
ich hätte auch gerne eineoder mal sagen wo man eine Kristallkugel her bekommt
ich hätte auch gerne eine
Ich eine mit TCP/IP-Connector, da kann der FS dann direkt testenich hätte dann gerne drei .Eine in blau, eine in rosa und eine "mit Farbe egal" aber dafür mit Hühnchengeschmack für meinen Hund.
Ich benutze bei sowas immer das Ausschlussverfahren ..
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?