27 Commits
Author SHA1 Message Date
Marek Safar 74c86ff4cc [System] Adds watch specific HttpListenerWebSocketContext 2017-05-31 19:16:38 +02:00
Marek Safar dba0a9c566 [System] WebSockets from corefx 2017-03-30 13:24:56 +02:00
Rolf Bjarne Kvinge e6536dd5e1 [System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)
* [System] Fix line endings for a few files.

Best reviewed by not showing whitespace changes (should be empty diff in that case).

* [System] Fix potential crash in CookieParserTests.

Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.

* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.

* [System.Net.Http] Tweak tests after watchOS API change.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Extract the HttpListenerResponseHelper class to a separate file.

Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.

* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.

* [System] Tweak tests after watchOS API changes.

Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.

* [System] Fix potential crash in SocketAcceptAsyncTest.

Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).

* [System] Avoid logic in SetUp attributes in tests.

Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.

This even happens for tests that do not need the logic in the [SetUp]
attribute.

So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.

* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.

* [System] Remove Obsolete attribute on API that throws PNSE.
2016-09-27 13:13:38 +02:00
Marek Safar 10c5e72512 [bcl] netstandart 1.6 support 2016-07-13 11:02:10 +02:00
Alexander Köplinger f959605062 Merge pull request #1345 from mattleibow/websocket-continuation-frame-fix
[system] WebSocket continuation frame incorrectly handles the message type
2016-04-27 11:04:43 -04:00
Zoltan Varga c1b4366932 [bcl] Remove NET_4_5 defines from class libs. 2015-01-13 16:34:23 -05:00
Alexander Köplinger 59d2397abc Merge branch 'patch-1' of https://github.com/ReubenBond/mono into ReubenBond-patch-1 2014-11-07 20:14:29 +01:00
Matthew Leibowitz e3719ebcfc [system] WebSocket continuation frame incorrectly handles the message type opcode
When a frame marked with OPCODE 0, it is a continuation frame. This frame does not carry the message type and should be derived from the previous frame.
2014-10-15 14:14:07 +02:00
Martin Baulig bbbcc73bde [websocket]: Fix ClientWebSocket.ReceiveAsync() with small buffer; bug #22704.
When calling ClientWebSocket.ReceiveAsync() with a buffer that's smaller than
the received chunk, we need to cache the header until next call.
2014-09-10 17:09:43 +02:00
Miguel de Icaza 9763da775f Fix fallout from WebSocketMessageType change.
The WebSocketMessageType values were being used to send data over the
wire.  This is likely the reason why WebSocketMessageType had values
that were not compatible with .NET.
2014-07-09 15:05:34 -04:00
Miguel de Icaza 1796d0df61 Fix enumeration values 2014-07-09 09:12:34 -04:00
Reuben Bond bbbe1e52d3 ClientWebSocket: SendAsync endOfMessage inverted.
endOfMessage should indicate whether or not additional message parts will follow the current one. Currently, the meaning in ClientWebSocket.cs is inverted: !endOfMessage indicates that no more parts will follow the current one.

See the WebSockets RFC, 'frame-fin' at the top of http://tools.ietf.org/html/rfc6455#page-31.
Also see the MSDN docs for SendAsync: http://msdn.microsoft.com/en-us/library/system.net.websockets.websocket.sendasync(v=vs.110).aspx
2014-06-20 16:48:36 +10:00
Marek Safar a6dccdaf6d Revert "Merge pull request #981 from methane/websocket"
This reverts commit 62cc262196, reversing
changes made to c1028cf912.
2014-05-23 17:24:45 +02:00
Miguel de Icaza e62f341e57 [build] Fix the build for NET_4_5 (and maybe other profiles) from the pull request 981 2014-05-20 22:04:29 -04:00
INADA Naoki c54a3f5d9d Fix indent of author. 2014-04-12 14:55:53 +09:00
INADA Naoki 32462f8089 Fix handling fragment and opcode. 2014-04-12 14:53:46 +09:00
INADA Naoki e4f842adf5 Use do ... while (true) 2014-04-12 03:23:31 +09:00
INADA Naoki 8f3f12726a Support receiving frame larger than buffer. 2014-04-12 03:21:01 +09:00
INADA Naoki e63e21edc2 Support CloseStatus 2014-04-12 03:06:36 +09:00
INADA Naoki 298e70c307 Fix some bugs. 2014-04-12 02:49:08 +09:00
INADA Naoki 4239b4cb2e Reimplement StreamWebSocket. 2014-04-11 23:15:24 +09:00
INADA Naoki 69ff10cc32 [websocket] Cleaner closing. 2014-04-07 10:53:43 +09:00
INADA Naoki 7e221721de [websocket] Implement HttpListenerContext.AcceptWebSocketAsync(). 2014-04-07 10:36:03 +09:00
Jérémie Laval 036ed3cc63 [System] Implement a first pass of ClientWebSocket. 2013-07-29 00:47:12 -04:00
Martin Baulig 4429891208 [System]: Stub out System.Net.WebSockets.ClientWebSocket. 2013-06-25 00:18:43 +02:00
Jérémie Laval 6431a69e79 [System] Add System.Net.WebSockets to the build 2013-02-24 20:48:18 +01:00
Jérémie Laval 3bc8c42183 [System] Add stub for System.Net.WebSockets 2013-02-24 20:34:34 +01:00