Send init message prior to triggering connect #1889

Closed
NTaylorMullen opened this Issue Apr 16, 2013 · 6 comments

Comments

Projects
None yet
5 participants
Contributor

NTaylorMullen commented Apr 16, 2013

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 added a commit that referenced this issue Apr 26, 2013

@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

#1889
d68cf3f

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Apr 26, 2013

@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 added a commit that referenced this issue Apr 26, 2013

@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 added a commit that referenced this issue Apr 26, 2013

@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

#1889
02c694c

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Apr 26, 2013

@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 added a commit that referenced this issue Apr 26, 2013

@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 added a commit that referenced this issue Apr 26, 2013

@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 added a commit that referenced this issue Apr 26, 2013

@NTaylorMullen NTaylorMullen Removed LongPolling from test because the init message handling is no…
…t currently implemented on the C# client

#1889
4c7620f

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 1, 2013

@NTaylorMullen NTaylorMullen Added the ability for connections to pre-buffer messages that are sen…
…t to them and then replay them.

#1889
0d71a80

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 1, 2013

@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 added a commit that referenced this issue May 1, 2013

@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 added a commit that referenced this issue May 1, 2013

@NTaylorMullen NTaylorMullen Added functional and unit tests to verify the message buffering and t…
…he init message functionality

#1889
653f973

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 1, 2013

@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 added a commit that referenced this issue May 1, 2013

@NTaylorMullen NTaylorMullen Removed LongPolling from test because the init message handling is no…
…t currently implemented on the C# client

#1889
4af205d

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 3, 2013

@NTaylorMullen NTaylorMullen Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
f6afd1e

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 3, 2013

@NTaylorMullen NTaylorMullen Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
099d60a

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 3, 2013

@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 added a commit that referenced this issue May 13, 2013

@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 added a commit that referenced this issue May 13, 2013

@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 added a commit that referenced this issue May 13, 2013

@NTaylorMullen NTaylorMullen Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
60f098c

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 13, 2013

@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 added a commit that referenced this issue May 13, 2013

@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 added a commit that referenced this issue May 13, 2013

@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 added a commit that referenced this issue May 13, 2013

@NTaylorMullen NTaylorMullen Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
eb5efe1

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 13, 2013

@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 was assigned May 14, 2013

Contributor

Xiaohongt commented May 15, 2013

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

Contributor

NTaylorMullen commented May 16, 2013

I can definitely see how that would happen, good catch

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 16, 2013

@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 added a commit that referenced this issue May 16, 2013

@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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl Added initialize logic to the common transports
- This way all transports utilize the same code path

#1889
d42251d

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl Updated TransportHelper to unify all onInitialized logic.
- Triggers the onInitialized function once an initialize message is received

#1889
e3c9c15

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 17, 2013

@NTaylorMullen @davidfowl NTaylorMullen + davidfowl 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 added a commit that referenced this issue May 17, 2013

@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 added a commit that referenced this issue May 17, 2013

@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 added a commit that referenced this issue May 17, 2013

@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
Owner

davidfowl commented May 19, 2013

@NTaylorMullen what's the deal with this?

Contributor

NTaylorMullen commented May 19, 2013

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

Owner

davidfowl commented May 19, 2013

Moved it to RC

Xiaohongt was assigned May 19, 2013

@NTaylorMullen NTaylorMullen added a commit that referenced this issue May 23, 2013

@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 added a commit that referenced this issue May 23, 2013

@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 added a commit that referenced this issue May 23, 2013

@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 added a commit that referenced this issue May 28, 2013

@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 added a commit that referenced this issue May 28, 2013

@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 added a commit that referenced this issue May 28, 2013

@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 added a commit that referenced this issue May 28, 2013

@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 added a commit that referenced this issue Jun 4, 2013

@NTaylorMullen @NTaylorMullen 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 added a commit that referenced this issue Jun 4, 2013

@NTaylorMullen @NTaylorMullen 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 added a commit that referenced this issue Jun 4, 2013

@NTaylorMullen @NTaylorMullen 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 added a commit that referenced this issue Jun 4, 2013

@NTaylorMullen @NTaylorMullen 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 was assigned Jun 5, 2013

Xiaohongt was assigned Jun 17, 2013

Contributor

Xiaohongt commented Jun 21, 2013

we logged new bug for any issue related to this fix

Xiaohongt closed this Jun 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment