Skip to content

Commit 7d6f350

Browse files
committed
Bug Fixing
* Fixed a bug whereby the non-reentrancy of some VIs was causing a race condition when multiple clients would connect to the same server. All VIs are not reentrant * Moved the project one level up in the directory structure * Added the release notes file
1 parent 21a1de7 commit 7d6f350

17 files changed

Lines changed: 28 additions & 7 deletions

Create URI.vi

84 Bytes
Binary file not shown.

CreateHTTPResponse.vi

104 Bytes
Binary file not shown.

DecodeCloseReason.vi

88 Bytes
Binary file not shown.

DoHandshake.vi

116 Bytes
Binary file not shown.

Examples/WebSockets Examples.aliases

Lines changed: 0 additions & 3 deletions
This file was deleted.

HeadersArrayToString.vi

92 Bytes
Binary file not shown.

LV WebSockets Release Notes.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
LV WebSockets Release Notes
2+
v1.0.0
3+
- Forked form v1.6.0.22 of the WebSockets package by MediaMongrels Ltd
4+
- Since the fork the following changes have been implemented
5+
* Fixed a bugs in client handshake code:
6+
1. the client needs to send an HTTP full URI and not a WS URI when we decide to put a full URI and not just the a path in the request.
7+
2. The regex in the "Parse URI.vi" method has been improved for the dummy resource name "/"
8+
* Refactored the client/server handshake code
9+
* added support for WebSockets resources as per RFC 6455
10+
* Now the server handshake checks if a resource is available as of the input array of resource and it answers with a 404 Not Found HTTP response according to the RFC 6455. The answer is handled by the client handshake code which throws an error. Server handshake similarly handles the malformed client handshake by answering with a 400 Bad Request HTTP response according to RFC 6455. The response is handled by the client code throwing an error. We added a "ProcessHandshakeResponse.vi" that fully check the server response as of RFC 6455, before there was only a partial check obtained by reusing "the ProcessHandshakeRequest.vi"server code.
11+
* Data Framing Refactoring: Introduced a generic "SendDataFrame.vi" which sends a data frame according to all the possible Opcodes as defined "Opcodes.ctl" enum and also allows to set the Final Frame Bit (FIN Bit). This vi is now used in both the "Write.vi" and "Close.vi", as well as the newly introduced "Ping.vi" and "Pong.vi".
12+
* The "Close.vi" now correctly sets the FIN bit and allows to send a Close Status as defined in the "StatusCode.ctl" ring and a close reason
13+
* A "DecodeCloseReason.vi" was introduced to decode the Close Status and the reason as delivered by the "Read.vi"
14+
* The "Write.vi" now can send binary an text data frames.
15+
* The "Read.vi" was refactored so as to allow also binary data, to read the FIN bit and the close reason in case of receive "Connection Close" opcode. As a result now the calling code has the tools to handle the multi-framing and the Ping/Pong exchanges.
16+
* The example server and clients were updated accordingly
17+
* Introduced an enum typedef defining the data format type either text or binary.Other minor changes
18+
* added a VI to create a valid websocket URI staring from IP address, port and service name. This VI is intended to facilitate the code modifications required when upgrading from older versions of the library where the the client handshake VI was not taking a ws URI as input but IP address and port separately
19+
* The Close method often follows the Read method returning the error 6066 "Closed by the peer". Checking of an input error within prevented it from sending Close frame in response, thus making the peer crash with the error 66 "TCP connection closed". This fix lets the Close message even if the error 6066 is present.

LV WebSockets.aliases

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[My Computer]
2+
My Computer = "172.27.112.1"

LV WebSockets.lvlps

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[ProjectWindow_Data]
2+
ProjectExplorer.ClassicPosition[String] = "85,145,911,664"
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='UTF-8'?>
2-
<Project Type="Project" LVVersion="17008000">
2+
<Project Type="Project" LVVersion="21008000">
33
<Property Name="NI.LV.All.SourceOnly" Type="Bool">false</Property>
44
<Property Name="NI.Project.Description" Type="Str">This project contains examples for using the WebSockets API provided by MediaMongrels Ltd</Property>
55
<Property Name="SMProvider.SMVersion" Type="Int">201310</Property>
@@ -22,12 +22,12 @@
2222
<Property Name="server.vi.propertiesEnabled" Type="Bool">true</Property>
2323
<Property Name="specify.custom.address" Type="Bool">false</Property>
2424
<Item Name="Single Connection" Type="Folder">
25-
<Item Name="Test Client" Type="Folder" URL="../Test Client">
25+
<Item Name="Test Client" Type="Folder" URL="../Examples/Test Client">
2626
<Property Name="NI.DISK" Type="Bool">true</Property>
2727
</Item>
28-
<Item Name="SingleConnection.vi" Type="VI" URL="../Test Server/SingleConnection.vi"/>
28+
<Item Name="SingleConnection.vi" Type="VI" URL="../Examples/Test Server/SingleConnection.vi"/>
2929
</Item>
30-
<Item Name="LV WebSockets.lvlib" Type="Library" URL="../../LV WebSockets.lvlib"/>
30+
<Item Name="LV WebSockets.lvlib" Type="Library" URL="../LV WebSockets.lvlib"/>
3131
<Item Name="Dependencies" Type="Dependencies">
3232
<Item Name="vi.lib" Type="Folder">
3333
<Item Name="BuildHelpPath.vi" Type="VI" URL="/&lt;vilib&gt;/Utility/error.llb/BuildHelpPath.vi"/>
@@ -58,6 +58,7 @@
5858
<Item Name="Open URL in Default Browser (string).vi" Type="VI" URL="/&lt;vilib&gt;/Platform/browser.llb/Open URL in Default Browser (string).vi"/>
5959
<Item Name="Open URL in Default Browser core.vi" Type="VI" URL="/&lt;vilib&gt;/Platform/browser.llb/Open URL in Default Browser core.vi"/>
6060
<Item Name="Open URL in Default Browser.vi" Type="VI" URL="/&lt;vilib&gt;/Platform/browser.llb/Open URL in Default Browser.vi"/>
61+
<Item Name="Path to URL inner.vi" Type="VI" URL="/&lt;vilib&gt;/printing/PathToURL.llb/Path to URL inner.vi"/>
6162
<Item Name="Path to URL.vi" Type="VI" URL="/&lt;vilib&gt;/printing/PathToURL.llb/Path to URL.vi"/>
6263
<Item Name="Search and Replace Pattern.vi" Type="VI" URL="/&lt;vilib&gt;/Utility/error.llb/Search and Replace Pattern.vi"/>
6364
<Item Name="Set Bold Text.vi" Type="VI" URL="/&lt;vilib&gt;/Utility/error.llb/Set Bold Text.vi"/>

0 commit comments

Comments
 (0)