Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Send init message prior to triggering connect #1889

Closed
NTaylorMullen opened this Issue · 6 comments

5 participants

@NTaylorMullen
Collaborator

When calling connection.start we currently just hit the signalr/connect endpoint. If we're using the long polling transport we try and ping the server and then do a /connect.

The issue with this is that we don't truly know if a user can connect to an endpoint, yet we still try and hit the endpoint (proves to be a large problem with long polling). A better alternative is to send an initialize message through the bus and then back down to the client. Upon receiving this init message the client will then hit the signalr/connect endpoint.

Implementations needed to complete feature

  • Server
  • JavaScript Client
  • C# Client
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added logic to handle the initialize message for the long polling tra…
…nsport

- Added incoming buffering of messages (if the client gets messages before initialize message)
- Removed the ping logic from the long polling transport

#1889
68c7d5c
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Moved the init message handling piece into the common transports file
- This way all transports utilize the same code path

#1889
98aae0a
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added logic to handle the initialize message for the long polling tra…
…nsport

- Added incoming buffering of messages (if the client gets messages before initialize message)
- Removed the ping logic from the long polling transport

#1889
ba185e1
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Moved the init message handling piece into the common transports file
- This way all transports utilize the same code path

#1889
bc491b9
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Changed how drainIncomingMessageBuffer deals with disconnects
- No longer check if the connection is disconnected because in stop it clears the buffer.

#1889
ced080b
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Removed LongPolling from test because the init message handling is no…
…t currently implemented on the C# client

#1889
4c7620f
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added logic to handle the initialize message for the long polling tra…
…nsport

- Added incoming buffering of messages (if the client gets messages before initialize message)
- Removed the ping logic from the long polling transport

#1889
a613deb
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Moved the init message handling piece into the common transports file
- This way all transports utilize the same code path

#1889
326a3fc
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Changed how drainIncomingMessageBuffer deals with disconnects
- No longer check if the connection is disconnected because in stop it clears the buffer.

#1889
0e87510
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Removed LongPolling from test because the init message handling is no…
…t currently implemented on the C# client

#1889
4af205d
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added core initialize message logic to the server
- Sends an initialize message after OnConnected is triggered to notify the client that it's ready for activity

#1889
a2254e6
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

- This will allow for people to send data in OnConnected

#1889
0542a97
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
f6afd1e
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified JS longPolling to utilize init message and cleaned
- Remove ping logic now that we support init message
- Also added the ability for the LongPolling transport to fail when a connection does not succeed

#1889
da93737
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Changed how the rest of the transports trigger the onInitialize event
- They now trigger initialize when they receive an initialize message (handled in process messages within the common transports)

#1889
83e128f
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified all transports to no longer trigger their initialize functio…
…n once they open.

- Instead they now trigger their initialize function once they receive an initialize message

#1889
4f1b9d1
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
099d60a
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a ConnectingMessageBuffer to handle pre-connect data that is pa…
…ssed to the client

- If a user sends data in OnConnected or a user receives data prior to being fully "connected" we buffer the messages and then replay them once we've received the initialize message.
- This is all handled within the connection itself
- Also added the ConnectingMessageBuffer to all of the client projects

#1889
02d7fe2
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added core initialize message logic to the server
- Sends an initialize message after OnConnected is triggered to notify the client that it's ready for activity

#1889
938d28a
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

- This will allow for people to send data in OnConnected

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.core.js
f641f1d
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
60f098c
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified JS longPolling to utilize init message and cleaned
- Remove ping logic now that we support init message
- Also added the ability for the LongPolling transport to fail when a connection does not succeed

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.transports.longPolling.js
fff0a85
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Changed how the rest of the transports trigger the onInitialize event
- They now trigger initialize when they receive an initialize message (handled in process messages within the common transports)

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.transports.serverSentEvents.js
8496208
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified all transports to no longer trigger their initialize functio…
…n once they open.

- Instead they now trigger their initialize function once they receive an initialize message

#1889
07eba1b
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
eb5efe1
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a ConnectingMessageBuffer to handle pre-connect data that is pa…
…ssed to the client

- If a user sends data in OnConnected or a user receives data prior to being fully "connected" we buffer the messages and then replay them once we've received the initialize message.
- This is all handled within the connection itself
- Also added the ConnectingMessageBuffer to all of the client projects

#1889
c11c2b6
@Xiaohongt Xiaohongt was assigned
@Xiaohongt
Collaborator

when scale-out down, on client webSockets will be in connecting forever e.g. below, it should be timeout and then disconnected

16:04:24 PDT]: disconnected => connecting undefined

@NTaylorMullen
Collaborator

I can definitely see how that would happen, good catch

@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting.
- All transports will now time out at the connection level
- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
0872796
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added tests to verify that transports will still timeout on connect w…
…hen they do not receive initialize message

#1889
03fcff5
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added core initialize message logic to the server
- Sends an initialize message after OnConnected is triggered to notify the client that it's ready for activity

#1889
cad1350
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

- This will allow for people to send data in OnConnected

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.core.js
e015e36
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
d42251d
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified JS longPolling to utilize init message and cleaned
- Remove ping logic now that we support init message
- Also added the ability for the LongPolling transport to fail when a connection does not succeed

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.transports.longPolling.js
a7834dc
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Changed how the rest of the transports trigger the onInitialize event
- They now trigger initialize when they receive an initialize message (handled in process messages within the common transports)

#1889

Conflicts:
	src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.transports.serverSentEvents.js
4a42f5f
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified all transports to no longer trigger their initialize functio…
…n once they open.

- Instead they now trigger their initialize function once they receive an initialize message

#1889
4a4775e
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
e3c9c15
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a ConnectingMessageBuffer to handle pre-connect data that is pa…
…ssed to the client

- If a user sends data in OnConnected or a user receives data prior to being fully "connected" we buffer the messages and then replay them once we've received the initialize message.
- This is all handled within the connection itself
- Also added the ConnectingMessageBuffer to all of the client projects

#1889
5120113
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Included TransportConnectTimeout to the list of configuration values …
…on the server

- This is also included in the negotiate response payload

#1889
2989477
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting in JS
- All transports will now time out at the connection level
- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
f69e7e1
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting time outs on C# client via…
… transport initialization handler

- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
db8491a
@davidfowl
Owner

@NTaylorMullen what's the deal with this?

@NTaylorMullen
Collaborator

@davidfowl Re-assigned it to working because of @Xiaohongt's bug, this is now waiting review in #2046

@davidfowl
Owner

Moved it to RC

@Xiaohongt Xiaohongt was assigned
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Included TransportConnectTimeout to the list of configuration values …
…on the server

- This is also included in the negotiate response payload

#1889
e87cad8
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting in JS
- All transports will now time out at the connection level
- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
6aa7128
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting time outs on C# client via…
… transport initialization handler

- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
2232c4f
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Included TransportConnectTimeout to the list of configuration values …
…on the server

- This is also included in the negotiate response payload

#1889
437702e
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting in JS
- All transports will now time out at the connection level
- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
48e7018
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting time outs on C# client via…
… transport initialization handler

- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
a108281
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added the ability for client's to override the servers transportConne…
…ctTimeout value.

- Also added tests to verify the new functionality.

#1889
5d06b28
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Included TransportConnectTimeout to the list of configuration values …
…on the server

- This is also included in the negotiate response payload

#1889
65f4377
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting in JS
- All transports will now time out at the connection level
- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
28a8ce9
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added unified timeout logic for connecting time outs on C# client via…
… transport initialization handler

- When transports would not receive an initialize message it would hang infinitely and stay in connecting

#1889
06c3a09
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added the ability for client's to override the servers transportConne…
…ctTimeout value.

- Also added tests to verify the new functionality.

#1889
ddd6f0e
@muratg muratg was assigned
@Xiaohongt Xiaohongt was assigned
@Xiaohongt
Collaborator

we logged new bug for any issue related to this fix

@Xiaohongt Xiaohongt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.