Commit Graph

80 Commits

Author SHA1 Message Date
Andy Wang
603b614009
Control flow optimisation in picking switchboard strategy 2020-12-29 23:58:18 +00:00
Andy Wang
b4d65d8a0e
Use sync.Map for lock free pickRandConn 2020-12-29 19:53:14 +00:00
Andy Wang
8ab0c2d96b
Redo the implementation of switchboard and remove the need for connId 2020-12-29 14:24:54 +00:00
Andy Wang
8dd4ae4bef
Better conform message data length to TLS standards 2020-12-29 00:16:24 +00:00
Andy Wang
cbd71fae6d
Control flow optimisations 2020-12-26 16:34:25 +00:00
Andy Wang
2d08e88efb
Use a sync.Pool to remove the global random bottleneck in picking a random conn 2020-12-26 13:48:42 +00:00
Andy Wang
2f17841f85
Use Compare-And-Swap for atomic booleans indicating session and switchboard closed 2020-12-25 23:16:57 +00:00
Andy Wang
977f51ce48 Add comments 2020-10-20 01:10:57 +01:00
Andy Wang
64d857c74d Rename variables for clarity 2020-10-18 15:36:40 +01:00
Andy Wang
c7c3f7706d Refactor for clarity and add comments 2020-10-18 14:42:47 +01:00
Andy Wang
3e133090f0 Give more descriptive names to multiplex objects 2020-10-15 22:51:36 +01:00
Andy Wang
d958de9938 Improve switchboard connscount 2020-04-17 01:04:26 +01:00
Andy Wang
f05cc19dbc Assign connId only when needed 2020-04-12 12:51:00 +01:00
Andy Wang
bbc0752883 Minor code cleanup 2020-04-09 19:10:04 +01:00
Andy Wang
7bfae8accd Refactor client side transport (breaks server) 2020-04-08 20:53:09 +01:00
Andy Wang
d3bc3b5a13 Use connutil in test 2020-04-08 16:41:39 +01:00
Andy Wang
43ae82ec0e Fix test, improve err message and fix nil interface casting 2020-04-08 15:58:46 +01:00
Andy Wang
2dc7c6d6e1 Correct switchboard valve's scope 2020-04-08 15:15:08 +01:00
Andy Wang
545164a300 Make send/receive buffer sizes configurable 2020-04-08 15:07:35 +01:00
Andy Wang
402cfc9e25 Logging for silent connections 2020-04-05 01:15:45 +01:00
Andy Wang
dc262f7ca5 actually change the connId of a stream upon new assignment in send 2020-04-05 00:52:06 +01:00
Andy Wang
766c27a129 Refactor if to switch case 2020-04-03 22:46:07 +01:00
Andy Wang
99fa812594 Fix pickRandConn bad loop 2020-01-22 22:17:18 +00:00
Andy Wang
bdd5308169 Code style clean up 2019-11-08 17:06:20 +00:00
Andy Wang
c26be98e79 Use sync.Map in multiplex instead of manual locks 2019-11-03 12:22:12 +00:00
Andy Wang
4c17923717 Make write error close session as well 2019-10-20 15:37:41 +01:00
Andy Wang
57f0c3d20a Close session when one connection drops 2019-10-16 23:00:23 +01:00
Andy Wang
beb6568ce0 Check before passive close 2019-10-15 22:06:23 +01:00
Andy Wang
6580e38e44 Introduce a special Session closing frame 2019-10-14 15:34:14 +01:00
Andy Wang
96215f116a Fix #61 2019-09-22 10:44:16 +01:00
Andy Wang
854dc422a2 Update some comments 2019-09-01 23:14:28 +01:00
Andy Wang
75dc91c15c Fix wrong wait type 2019-08-31 15:33:23 +01:00
Andy Wang
4861efbc50 Fix #54 2019-08-31 15:32:57 +01:00
Andy Wang
c3ff3f5d1a Fix the weird nil pointer again 2019-08-21 13:14:23 +01:00
Andy Wang
bbb0d35e80 Remove conns from map once switchboard.CloseAll is called 2019-08-20 23:15:36 +01:00
Andy Wang
87a7684e10 More comments 2019-08-20 22:43:04 +01:00
Andy Wang
52796ad0b1 recvDataFromRemote returns err 2019-08-16 23:47:15 +01:00
Andy Wang
c1b1d5d8ba Fix accidentally removed tx qos 2019-08-14 11:56:55 +01:00
Andy Wang
c36ec04ce5 Add unordered mode 2019-08-14 11:56:55 +01:00
Andy Wang
8967819830 Fix accidentally removed tx qos 2019-08-14 10:28:08 +01:00
Qian Wang
71e48a1947 Refactor switchboard configuration and add unordered option 2019-08-12 00:48:20 +01:00
Qian Wang
cb672a99de Refactor session configuration 2019-08-12 00:22:15 +01:00
Qian Wang
abc83a9190 Potential fix to an edge case nil pointer 2019-08-09 10:36:27 +01:00
Qian Wang
d99b4009b2 Differentiate concrete types of LimitedValve and UnlimitedValve to avoid unnecessary atomic.AddUint64 since it has non-trivial overhead on embedded systems 2019-08-07 15:43:42 +01:00
Qian Wang
e7aa4cd04b Fix a stuck mutex 2019-08-07 13:59:27 +01:00
Qian Wang
3002c87a49 Fix a server crashing null pointer 2019-08-06 21:04:08 +01:00
Qian Wang
01036086c7 Change the frame distribution strategy so that each stream is assigned a fixed underlying TCP connection to send its frames to reduce framesorter ooo count 2019-08-05 22:14:11 +01:00
Qian Wang
fac381dbca Refactor switchboard 2019-08-05 14:33:20 +01:00
Qian Wang
d46fa74924 Refactor frame sorter 2019-08-05 13:32:53 +01:00
Qian Wang
9fcc328797 Fix a mutex deadlock 2019-08-05 13:17:02 +01:00