├── .gitignore ├── DETAILS.md ├── LICENSE.md ├── README.md ├── Src ├── SocketIoClientDotNet.Tests.mono │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.Tests.mono.csproj │ ├── app.config │ └── packages.config ├── SocketIoClientDotNet.Tests.net35 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.Tests.net35.csproj │ ├── app.config │ └── packages.config ├── SocketIoClientDotNet.Tests.net40 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.Tests.net40.csproj │ ├── app.config │ ├── config.json │ └── packages.config ├── SocketIoClientDotNet.Tests.net45 │ ├── ClientTests │ │ ├── Connection.cs │ │ ├── ConnectionConstants.cs │ │ ├── Connection_device.cs │ │ ├── ServerConnectionTest.cs │ │ ├── ServerConnectionTest_net35.cs │ │ └── UrlTest.cs │ ├── ModuleTests │ │ └── HasBinaryDataTest.cs │ ├── ParserTests │ │ ├── ByteArrayTest.cs │ │ ├── Helpers.cs │ │ └── ParserTest.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.Tests.net45.csproj │ ├── app.config │ └── packages.config ├── SocketIoClientDotNet.Tests.netstandard1.3 │ └── SocketIoClientDotNet.Tests.netstandard1.3.csproj ├── SocketIoClientDotNet.mono │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.mono.csproj │ ├── SocketIoClientDotNet.mono.sln │ └── packages.config ├── SocketIoClientDotNet.net35 │ ├── .vs │ │ ├── SocketIoClientDotNet.net35 │ │ │ └── v15 │ │ │ │ └── sqlite3 │ │ │ │ └── storage.ide │ │ └── config │ │ │ └── applicationhost.config │ ├── Collections.Concurrent │ │ └── ConcurrentQueue.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.net35.csproj │ ├── SocketIoClientDotNet.net35.sln │ ├── app.config │ └── packages.config ├── SocketIoClientDotNet.net40 │ ├── .vs │ │ ├── SocketIoClientDotNet.net40 │ │ │ └── v15 │ │ │ │ └── sqlite3 │ │ │ │ └── storage.ide │ │ └── config │ │ │ └── applicationhost.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.net40.csproj │ ├── SocketIoClientDotNet.net40.sln │ ├── app.config │ └── packages.config ├── SocketIoClientDotNet.net45 │ ├── .vs │ │ └── SocketIoClientDotNet.net45 │ │ │ └── v15 │ │ │ └── sqlite3 │ │ │ └── storage.ide │ ├── Client │ │ ├── AckImpl.cs │ │ ├── IAck.cs │ │ ├── IO.cs │ │ ├── IO_net35.cs │ │ ├── Manager.cs │ │ ├── Manager_net35.cs │ │ ├── On.cs │ │ ├── Socket.cs │ │ ├── SocketIOException.cs │ │ ├── Socket_net35.cs │ │ ├── Socket_net40.cs │ │ └── Url.cs │ ├── Modules │ │ └── HasBinaryData.cs │ ├── Parser │ │ ├── Binary.cs │ │ ├── Packet.cs │ │ └── Parser.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SocketIoClientDotNet.net45.csproj │ ├── SocketIoClientDotNet.net45.sln │ ├── app.config │ └── packages.config └── SocketIoClientDotNet.netstandard1.3 │ ├── .vs │ └── SocketIoClientDotNet.netstandard1.3 │ │ └── v15 │ │ └── sqlite3 │ │ └── storage.ide │ ├── SocketIoClientDotNet.netstandard1.3.csproj │ └── SocketIoClientDotNet.netstandard1.3.sln ├── TestServer ├── .gitignore ├── .jshintrc ├── index.html ├── package.json ├── server.js ├── test.txt ├── test_data.json ├── testme.quobject.com.cert ├── testme.quobject.com.key └── testme.quobject.com.p7b ├── grunt ├── .gitignore ├── .jshintrc ├── Gruntfile.js ├── config.json ├── package.json ├── tasks │ ├── build-client.js │ ├── build-test.js │ ├── createNugetPackage.js │ ├── createXamarinComponent.js │ ├── install-npm.js │ ├── nuget.js │ ├── start-server.js │ └── test-client.js └── templates │ ├── AssemblyInfo.cs │ ├── SocketIoClientDotNet - xamarin.nuspec │ ├── SocketIoClientDotNet.nuspec │ └── SocketIoClientDotNet.yaml └── pics ├── donate-bitcoins.png ├── donate-paypal.gif ├── issues.png ├── socketio.svg ├── socketio_1024x1024.png ├── socketio_128x128.png ├── socketio_256x256.png └── socketio_512x512.png /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | Releases 4 | Working 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.sln.docstates 10 | 11 | # Build results 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Rr]elease/ 15 | x64/ 16 | build/ 17 | bld/ 18 | [Bb]in/ 19 | [Oo]bj/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | #NUNIT 26 | *.VisualState.xml 27 | TestResult.xml 28 | 29 | # Build Results of an ATL Project 30 | [Dd]ebugPS/ 31 | [Rr]eleasePS/ 32 | dlldata.c 33 | 34 | *_i.c 35 | *_p.c 36 | *_i.h 37 | *.ilk 38 | *.meta 39 | *.obj 40 | *.pch 41 | *.pdb 42 | *.pgc 43 | *.pgd 44 | *.rsp 45 | *.sbr 46 | *.tlb 47 | *.tli 48 | *.tlh 49 | *.tmp 50 | *.tmp_proj 51 | *.log 52 | *.vspscc 53 | *.vssscc 54 | .builds 55 | *.pidb 56 | *.svclog 57 | *.scc 58 | 59 | # Chutzpah Test files 60 | _Chutzpah* 61 | 62 | # Visual C++ cache files 63 | ipch/ 64 | *.aps 65 | *.ncb 66 | *.opensdf 67 | *.sdf 68 | *.cachefile 69 | 70 | # Visual Studio profiler 71 | *.psess 72 | *.vsp 73 | *.vspx 74 | 75 | # TFS 2012 Local Workspace 76 | $tf/ 77 | 78 | # Guidance Automation Toolkit 79 | *.gpState 80 | 81 | # ReSharper is a .NET coding add-in 82 | _ReSharper*/ 83 | *.[Rr]e[Ss]harper 84 | *.DotSettings.user 85 | 86 | # JustCode is a .NET coding addin-in 87 | .JustCode 88 | 89 | # TeamCity is a build add-in 90 | _TeamCity* 91 | 92 | # DotCover is a Code Coverage Tool 93 | *.dotCover 94 | 95 | # NCrunch 96 | *.ncrunch* 97 | _NCrunch_* 98 | .*crunch*.local.xml 99 | 100 | # MightyMoose 101 | *.mm.* 102 | AutoTest.Net/ 103 | 104 | # Web workbench (sass) 105 | .sass-cache/ 106 | 107 | # Installshield output folder 108 | [Ee]xpress/ 109 | 110 | # DocProject is a documentation generator add-in 111 | DocProject/buildhelp/ 112 | DocProject/Help/*.HxT 113 | DocProject/Help/*.HxC 114 | DocProject/Help/*.hhc 115 | DocProject/Help/*.hhk 116 | DocProject/Help/*.hhp 117 | DocProject/Help/Html2 118 | DocProject/Help/html 119 | 120 | # Click-Once directory 121 | publish/ 122 | 123 | # Publish Web Output 124 | *.[Pp]ublish.xml 125 | *.azurePubxml 126 | 127 | # NuGet Packages Directory 128 | packages/ 129 | ## TODO: If the tool you use requires repositories.config uncomment the next line 130 | #!packages/repositories.config 131 | 132 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 133 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 134 | !packages/build/ 135 | 136 | # Windows Azure Build Output 137 | csx/ 138 | *.build.csdef 139 | 140 | # Windows Store app package directory 141 | AppPackages/ 142 | 143 | # Others 144 | sql/ 145 | *.Cache 146 | ClientBin/ 147 | [Ss]tyle[Cc]op.* 148 | ~$* 149 | *~ 150 | *.dbmdl 151 | *.dbproj.schemaview 152 | *.pfx 153 | *.publishsettings 154 | node_modules/ 155 | 156 | # RIA/Silverlight projects 157 | Generated_Code/ 158 | 159 | # Backup & report files from converting an old project file to a newer 160 | # Visual Studio version. Backup files are not needed, because we have git ;-) 161 | _UpgradeReport_Files/ 162 | Backup*/ 163 | UpgradeLog*.XML 164 | UpgradeLog*.htm 165 | 166 | # SQL Server files 167 | *.mdf 168 | *.ldf 169 | 170 | # Business Intelligence projects 171 | *.rdl.data 172 | *.bim.layout 173 | *.bim_*.settings 174 | 175 | # Microsoft Fakes 176 | FakesAssemblies/ 177 | EngineIoClientDotNet_Tests/Resources/test.xml 178 | TestServer/test.xml 179 | TestServer/test.xml 180 | TestServer/test.xml 181 | -------------------------------------------------------------------------------- /DETAILS.md: -------------------------------------------------------------------------------- 1 | # Socket.IO .NET 2 | 3 | Socket.IO enables real-time bidirectional event-based communication. 4 | It works on every platform, browser or device, focusing equally on reliability and speed. 5 | 6 | * **Real-time analytics** 7 | Push data to clients that gets represented as real-time counters, charts or logs. 8 | * **Instant messaging and chat** 9 | Socket.IO's "Hello world" is a chat app in just a few lines of code. 10 | * **Binary streaming** 11 | Starting in 1.0, it's possible to send any blob back and forth: image, audio, video. 12 | * **Document collaboration** 13 | Allow users to concurrently edit a document and see each other's changes. 14 | 15 | > **USED BY EVERYONE** 16 | > From Microsoft Office, Yammer, Zendesk, Trello... to hackathon winners and little startups. 17 | 18 | > **IMMENSELY POWERFUL, YET EASY TO USE** 19 | > Our getting started guide will show you how to create lots of amazing applications in fewer 20 | > than 200 lines of code. 21 | 22 | ## Connect to Server 23 | 24 | Connecting to a Socket.IO server is just two lines: 25 | 26 | // connect to a Socket.IO server 27 | socket = IO.Socket("http://chat.socket.io/"); 28 | socket.Connect(); 29 | 30 | // disconnect from the server 31 | socket.Close(); 32 | 33 | ## Subscribe to Events 34 | 35 | Listening for messages from the server is easy,all we need to do is 36 | attach a delegate to the event name using the `On` method. 37 | 38 | The `data` received from the http://chat.socket.io/ server is a `JToken` value: 39 | 40 | // whenever the server emits "login", print the login message 41 | socket.On("login", data => { 42 | connected = true; 43 | 44 | // get the json data from the server message 45 | var jobject = data as JToken; 46 | 47 | // get the number of users 48 | var numUsers = jobject.Value("numUsers"); 49 | 50 | // display the welcome message... 51 | }); 52 | 53 | // whenever the server emits "new message", update the chat body 54 | socket.On("new message", data => { 55 | // get the json data from the server message 56 | var jobject = data as JToken; 57 | 58 | // get the message data values 59 | var username = jobject.Value("username"); 60 | var message = jobject.Value("message"); 61 | 62 | // display message... 63 | }); 64 | 65 | ## Send a Message 66 | 67 | Sending a message to the server is just a single line of code that makes use of the 68 | `Emit` method: 69 | 70 | // we can send messages to the server 71 | socket.Emit("add user", "username"); 72 | if (connected) { 73 | socket.Emit("new message", "This is a message from Xamarin.Android..."); 74 | } 75 | 76 | // or we can just send events 77 | socket.Emit("typing"); 78 | // cancel that typing event 79 | socket.Emit("stop typing"); 80 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Quobject 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THIS PROJECT IS DEPRECATED 2 | Component is not maintained anymore. See https://github.com/Quobject/EngineIoClientDotNet/issues/69 for more information. 3 | 4 | #### SocketIoClientDotNet 5 | ==================== 6 | 7 | Socket.IO Client Library for .Net 8 | 9 | * NuGet Package: [![SocketIoClientDotNet](https://img.shields.io/nuget/v/SocketIoClientDotNet.svg?maxAge=2592000)](https://www.nuget.org/packages/SocketIoClientDotNet/) 10 | 11 | This is the Socket.IO Client Library for C#, which is ported from the [JavaScript client](https://github.com/Automattic/socket.io-client) version [1.1.0](https://github.com/socketio/socket.io-client/releases/tag/1.1.0). 12 | 13 | See also: [EngineIoClientDotNet](https://github.com/Quobject/EngineIoClientDotNet) 14 | 15 | #### Installation 16 | [Nuget install](https://www.nuget.org/packages/SocketIoClientDotNet/): 17 | ``` 18 | Install-Package SocketIoClientDotNet 19 | ``` 20 | 21 | #### Usage 22 | SocketIoClientDotNet has a similar api to those of the [JavaScript client](https://github.com/Automattic/socket.io-client). 23 | 24 | ```cs 25 | using Quobject.SocketIoClientDotNet.Client; 26 | 27 | var socket = IO.Socket("http://localhost"); 28 | socket.On(Socket.EVENT_CONNECT, () => 29 | { 30 | socket.Emit("hi"); 31 | 32 | }); 33 | 34 | socket.On("hi", (data) => 35 | { 36 | Console.WriteLine(data); 37 | socket.Disconnect(); 38 | }); 39 | Console.ReadLine(); 40 | ``` 41 | 42 | More examples can be found in [unit tests](https://github.com/Quobject/SocketIoClientDotNet/blob/master/Src/SocketIoClientDotNet.Tests.net45/ClientTests/ServerConnectionTest.cs) acting against the [test server](https://github.com/Quobject/SocketIoClientDotNet/blob/master/TestServer/server.js). 43 | 44 | #### Features 45 | This library supports all of the features the JS client does, including events, options and upgrading transport. 46 | 47 | #### Framework Versions 48 | .NETFramework v3.5, .NETFramework v4.0, .NETFramework v4.5 49 | 50 | ## License 51 | 52 | [MIT](http://opensource.org/licenses/MIT) 53 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.mono/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SocketIoClientDotNet.Tests.mono")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SocketIoClientDotNet.Tests.mono")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0df2fc9c-4abf-4925-9617-c374461b8ea7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.mono/SocketIoClientDotNet.Tests.mono.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {022DE7B5-7AA6-447A-8720-DDF627C384FD} 9 | Library 10 | Properties 11 | SocketIoClientDotNet.Tests.mono 12 | SocketIoClientDotNet.Tests.mono 13 | v4.5 14 | 512 15 | 56483a1c 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\SocketIoClientDotNet.mono\packages\EngineIoClientDotNet.0.9.18\lib\net45\EngineIoClientDotNet.dll 37 | True 38 | 39 | 40 | ..\SocketIoClientDotNet.mono\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll 41 | True 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | ..\SocketIoClientDotNet.mono\packages\WebSocket4Net.0.12\lib\net45\WebSocket4Net.dll 53 | True 54 | 55 | 56 | ..\SocketIoClientDotNet.mono\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll 57 | True 58 | 59 | 60 | ..\SocketIoClientDotNet.mono\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll 61 | True 62 | 63 | 64 | ..\SocketIoClientDotNet.mono\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll 65 | True 66 | 67 | 68 | 69 | 70 | ClientTests\Connection.cs 71 | 72 | 73 | ClientTests\ServerConnectionTest.cs 74 | 75 | 76 | ClientTests\UrlTest.cs 77 | 78 | 79 | ModuleTests\HasBinaryDataTest.cs 80 | 81 | 82 | ParserTests\ByteArrayTest.cs 83 | 84 | 85 | ParserTests\Helpers.cs 86 | 87 | 88 | ParserTests\ParserTest.cs 89 | 90 | 91 | 92 | 93 | 94 | {9c663463-8a1d-4960-a64a-1e0303034fe2} 95 | SocketIoClientDotNet.mono 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 106 | 107 | 108 | 109 | 116 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.mono/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.mono/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SocketIoClientDotNet.Tests.net35")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SocketIoClientDotNet.Tests.net35")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bf93a8d2-2707-4a53-93d6-a6a00af2f1d5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net35/SocketIoClientDotNet.Tests.net35.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {6D90EB17-A71E-4A5F-8BF1-1F7991AEB976} 8 | Library 9 | Properties 10 | SocketIoClientDotNet.Tests 11 | SocketIoClientDotNet.Tests.net35 12 | v3.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\SocketIoClientDotNet.net35\packages\EngineIoClientDotNet.1.0.0.1-beta1\lib\net35\EngineIoClientDotNet.dll 35 | 36 | 37 | ..\SocketIoClientDotNet.net35\packages\Newtonsoft.Json.9.0.1\lib\net35\Newtonsoft.Json.dll 38 | 39 | 40 | ..\SocketIoClientDotNet.net35\packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net35-client\SuperSocket.ClientEngine.dll 41 | 42 | 43 | 44 | 45 | False 46 | ..\SocketIoClientDotNet.net35\packages\System.Threading.Tasks.Unofficial.3.1\lib\net35\System.Threading.Tasks.NET35.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | ..\SocketIoClientDotNet.net35\packages\WebSocket4Net.0.15.0-beta9\lib\net35\WebSocket4Net.dll 54 | 55 | 56 | ..\SocketIoClientDotNet.net35\packages\xunit.1.9.2\lib\net20\xunit.dll 57 | True 58 | 59 | 60 | 61 | 62 | ClientTests\Connection.cs 63 | 64 | 65 | ClientTests\ConnectionConstants.cs 66 | 67 | 68 | ClientTests\ServerConnectionTest_net35.cs 69 | 70 | 71 | ClientTests\UrlTest.cs 72 | 73 | 74 | ModuleTests\HasBinaryDataTest.cs 75 | 76 | 77 | ParserTests\ByteArrayTest.cs 78 | 79 | 80 | ParserTests\Helpers.cs 81 | 82 | 83 | ParserTests\ParserTest.cs 84 | 85 | 86 | 87 | 88 | 89 | 90 | Designer 91 | 92 | 93 | 94 | 95 | {e3d3a67d-9a1e-4915-8a2d-1c0e4447f5e0} 96 | SocketIoClientDotNet.net35 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net35/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net35/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SocketIoClientDotNet.Tests.net40")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SocketIoClientDotNet.Tests.net40")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b7bc8677-efa2-47e2-86c3-1ab3f31238c3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net40/SocketIoClientDotNet.Tests.net40.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DD1A4F5E-5606-4989-9DF8-C1BBD50CD850} 8 | Library 9 | Properties 10 | SocketIoClientDotNet.Tests.net40 11 | SocketIoClientDotNet.Tests.net40 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | false 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | false 34 | 35 | 36 | 37 | ..\SocketIoClientDotNet.net40\packages\EngineIoClientDotNet.1.0.0.1-beta1\lib\net40\EngineIoClientDotNet.dll 38 | 39 | 40 | ..\SocketIoClientDotNet.net40\packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll 41 | 42 | 43 | ..\SocketIoClientDotNet.net40\packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net40-client\SuperSocket.ClientEngine.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | ..\SocketIoClientDotNet.net40\packages\WebSocket4Net.0.15.0-beta9\lib\net40\WebSocket4Net.dll 55 | 56 | 57 | ..\SocketIoClientDotNet.net40\packages\xunit.1.9.2\lib\net20\xunit.dll 58 | True 59 | 60 | 61 | 62 | 63 | ClientTests\Connection.cs 64 | 65 | 66 | ClientTests\ConnectionConstants.cs 67 | 68 | 69 | ClientTests\ServerConnectionTest_net35.cs 70 | 71 | 72 | ClientTests\UrlTest.cs 73 | 74 | 75 | ModuleTests\HasBinaryDataTest.cs 76 | 77 | 78 | ParserTests\ByteArrayTest.cs 79 | 80 | 81 | ParserTests\Helpers.cs 82 | 83 | 84 | ParserTests\ParserTest.cs 85 | 86 | 87 | 88 | 89 | 90 | {53ae4914-a35b-406c-91ed-7e3d9c950f45} 91 | SocketIoClientDotNet.net40 92 | 93 | 94 | 95 | 96 | 97 | Always 98 | 99 | 100 | 101 | 102 | 109 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net40/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net40/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"0.10.0", 3 | "server":{ 4 | "port":80, 5 | "ssl_port":443, 6 | "hostname":"127.0.0.1" 7 | }, 8 | "win":{ 9 | "powershell":"C:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe", 10 | "msbuild":"C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe", 11 | "xunit_path":"C:/Development/quobject.visualstudio.com/EngineIoClientDotNet/Src/EngineIoClientDotNet.net45/packages/xunit.runner.console.2.0.0/tools", 12 | "nuget":"C:/ProgramData/chocolatey/bin/NuGet.exe", 13 | "xamarin_component":"xamarin-component.exe" 14 | }, 15 | "linux":{ 16 | "msbuild":"xbuild", 17 | "xunit_path":"/home/apollo/vendors/xunit", 18 | "xamarin_component":"xamarin-component" 19 | } 20 | } -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net40/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ClientTests/Connection.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Quobject.EngineIoClientDotNet.Modules; 3 | using Quobject.SocketIoClientDotNet.Client; 4 | using System.IO; 5 | 6 | namespace SocketIoClientDotNet.Tests.ClientTests 7 | { 8 | public class Connection 9 | { 10 | public static readonly int TIMEOUT = 300000; 11 | 12 | static Connection() 13 | { 14 | LogManager.SetupLogManager(); 15 | } 16 | 17 | protected IO.Options CreateOptions() 18 | { 19 | var log = LogManager.GetLogger(Global.CallerName()); 20 | 21 | 22 | var config = ConfigBase.Load(); 23 | var options = new IO.Options(); 24 | options.Port = config.server.port; 25 | options.Hostname = config.server.hostname; 26 | options.ForceNew = true; 27 | log.Info("Please add to your hosts file: 127.0.0.1 " + options.Hostname); 28 | 29 | return options; 30 | } 31 | 32 | protected string CreateUri() 33 | { 34 | var options = CreateOptions(); 35 | var uri = string.Format("{0}://{1}:{2}", options.Secure ? "https" : "http", options.Hostname, options.Port); 36 | return uri; 37 | } 38 | 39 | 40 | protected IO.Options CreateOptionsSecure() 41 | { 42 | var log = LogManager.GetLogger(Global.CallerName()); 43 | 44 | var config = ConfigBase.Load(); 45 | var options = new IO.Options(); 46 | options.Port = config.server.ssl_port; 47 | options.Hostname = config.server.hostname; 48 | log.Info("Please add to your hosts file: 127.0.0.1 " + options.Hostname); 49 | options.Secure = true; 50 | options.IgnoreServerCertificateValidation = true; 51 | return options; 52 | } 53 | } 54 | 55 | public class ConfigBase 56 | { 57 | public string version { get; set; } 58 | public ConfigServer server { get; set; } 59 | 60 | public static ConfigBase Load() 61 | { 62 | var result = new ConfigBase() 63 | { 64 | server = new ConfigServer() 65 | }; 66 | result.server.hostname = ConnectionConstants.HOSTNAME; 67 | result.server.port = ConnectionConstants.PORT; 68 | result.server.ssl_port = ConnectionConstants.SSL_PORT; 69 | 70 | return result; 71 | } 72 | } 73 | 74 | public class ConfigServer 75 | { 76 | public string hostname { get; set; } 77 | public int port { get; set; } 78 | public int ssl_port { get; set; } 79 | } 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ClientTests/ConnectionConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SocketIoClientDotNet.Tests.ClientTests 7 | { 8 | public static class ConnectionConstants 9 | { 10 | public static int PORT = 80; 11 | public static string HOSTNAME = "testme.quobject.com"; 12 | public static int SSL_PORT = 443; 13 | public static readonly int TIMEOUT = 300000; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ClientTests/Connection_device.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Quobject.EngineIoClientDotNet.Modules; 3 | using Quobject.SocketIoClientDotNet.Client; 4 | using System.IO; 5 | 6 | namespace SocketIoClientDotNet.Tests.ClientTests 7 | { 8 | public class Connection 9 | { 10 | public static readonly int TIMEOUT = 300000; 11 | 12 | static Connection() 13 | { 14 | LogManager.SetupLogManager(); 15 | } 16 | 17 | protected IO.Options CreateOptions() 18 | { 19 | //var log = LogManager.GetLogger(Global.CallerName()); 20 | 21 | 22 | var config = ConfigBase.Load(); 23 | var options = new IO.Options(); 24 | options.Port = config.server.port; 25 | options.Hostname = config.server.hostname; 26 | options.ForceNew = true; 27 | //log.Info("Please add to your hosts file: 127.0.0.1 " + options.Hostname); 28 | 29 | return options; 30 | } 31 | 32 | protected string CreateUri() 33 | { 34 | var options = CreateOptions(); 35 | var uri = string.Format("{0}://{1}:{2}", options.Secure ? "https" : "http", options.Hostname, options.Port); 36 | return uri; 37 | } 38 | 39 | 40 | protected IO.Options CreateOptionsSecure() 41 | { 42 | //var log = LogManager.GetLogger(Global.CallerName()); 43 | 44 | var config = ConfigBase.Load(); 45 | var options = new IO.Options(); 46 | options.Port = config.server.ssl_port; 47 | options.Hostname = config.server.hostname; 48 | //log.Info("Please add to your hosts file: 127.0.0.1 " + options.Hostname); 49 | options.Secure = true; 50 | options.IgnoreServerCertificateValidation = true; 51 | return options; 52 | } 53 | } 54 | 55 | public class ConfigBase 56 | { 57 | public string version { get; set; } 58 | public ConfigServer server { get; set; } 59 | 60 | public static ConfigBase Load() 61 | { 62 | //var configString = File.ReadAllText("./../../../../grunt/config.json"); 63 | var configString = @"{""version"":""0.1.0.0"",""server"":{""port"":80,""ssl_port"":443,""hostname"":""192.168.178.59""},""win"":{""powershell"":""C:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe"",""msbuild"":""C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe"",""xunit_path"":""C:/vendors/xunit"",""nuget"":""C:/vendors/nuget/nuget.exe""},""linux"":{""msbuild"":""xbuild"",""xunit_path"":""/home/apollo/vendors/xunit""}}"; 64 | 65 | var config = JsonConvert.DeserializeObject(configString); 66 | return config; 67 | } 68 | } 69 | 70 | public class ConfigServer 71 | { 72 | public string hostname { get; set; } 73 | public int port { get; set; } 74 | public int ssl_port { get; set; } 75 | } 76 | } 77 | 78 | 79 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ClientTests/UrlTest.cs: -------------------------------------------------------------------------------- 1 | using Quobject.SocketIoClientDotNet.Client; 2 | using Xunit; 3 | 4 | namespace SocketIoClientDotNet.Tests.ClientTests 5 | { 6 | public class UrlTest 7 | { 8 | [Fact] 9 | public void Parse() 10 | { 11 | const string test = @"http://username:password@host:8080/directory/file?query#ref"; 12 | var result = Url.Parse(test); 13 | var str = result.ToString(); 14 | Assert.Equal(test,str); 15 | } 16 | 17 | [Fact] 18 | public void ParseRelativePath() 19 | { 20 | const string test = @"https://woot.com/test"; 21 | var result = Url.Parse(test); 22 | Assert.Equal("https",result.Scheme); 23 | Assert.Equal("woot.com",result.Host); 24 | Assert.Equal("/test",result.LocalPath); 25 | } 26 | 27 | [Fact] 28 | public void ParseNoProtocol() 29 | { 30 | const string test = @"//localhost:3000"; 31 | var result = Url.Parse(test); 32 | Assert.Equal("http", result.Scheme); 33 | Assert.Equal("localhost", result.Host); 34 | Assert.Equal(3000, result.Port); 35 | } 36 | 37 | [Fact] 38 | public void ParseNamespace() 39 | { 40 | var result = Url.Parse(@"http://woot.com/woot"); 41 | Assert.Equal("/woot", result.LocalPath); 42 | result = Url.Parse(@"http://google.com"); 43 | Assert.Equal("/", result.LocalPath); 44 | result = Url.Parse(@"http://google.com/"); 45 | Assert.Equal("/", result.LocalPath); 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ModuleTests/HasBinaryDataTest.cs: -------------------------------------------------------------------------------- 1 | using Quobject.SocketIoClientDotNet.Modules; 2 | using Xunit; 3 | 4 | namespace SocketIoClientDotNet.Tests.ModuleTests 5 | { 6 | public class HasBinaryDataTest 7 | { 8 | [Fact] 9 | public void ByteArray() 10 | { 11 | Assert.True(HasBinaryData.HasBinary(new byte[0])); 12 | } 13 | 14 | //[Fact] 15 | //public void ArrayContainsByteArray() 16 | //{ 17 | // var arr = JArray.Parse(@"[1, null, 2]"); 18 | // var bytes = System.Text.Encoding.UTF8.GetBytes("asdfasdf"); 19 | // var token = JToken.FromObject(bytes); 20 | // arr.Add(token); 21 | // Assert.True(HasBinaryData.HasBinary(arr)); 22 | //} 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ParserTests/ByteArrayTest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using Quobject.SocketIoClientDotNet.Parser; 3 | using System.Collections.Generic; 4 | using Xunit; 5 | 6 | namespace SocketIoClientDotNet.Tests.ParserTests 7 | { 8 | public class ByteArrayTest 9 | { 10 | 11 | [Fact] 12 | public void EncodeByteArray() 13 | { 14 | var packet = new Packet(Parser.BINARY_EVENT) 15 | { 16 | Id = 23, 17 | Nsp = "/woot", 18 | Data = System.Text.Encoding.UTF8.GetBytes("abc") 19 | }; 20 | Helpers.TestBin(packet); 21 | } 22 | 23 | [Fact] 24 | public void EncodeByteArray2() 25 | { 26 | var packet = new Packet(Parser.BINARY_EVENT) 27 | { 28 | Id = 0, 29 | Nsp = "/", 30 | Data = new byte[2] 31 | }; 32 | Helpers.TestBin(packet); 33 | } 34 | 35 | 36 | 37 | [Fact] 38 | public void EncodeByteArrayInJson() 39 | { 40 | var exptected = System.Text.Encoding.UTF8.GetBytes("asdfasdf"); 41 | var _args = new List { "buffa" }; 42 | _args.Add(exptected); 43 | 44 | var data = Packet.Args2JArray(_args); 45 | 46 | var packet = new Packet() 47 | { 48 | Type = Parser.BINARY_EVENT, 49 | Id = 999, 50 | Nsp = "/deep", 51 | Data = data 52 | }; 53 | Helpers.TestBin(packet); 54 | } 55 | 56 | [Fact] 57 | public void EncodeByteArrayDeepInJson() 58 | { 59 | var buf = System.Text.Encoding.UTF8.GetBytes("howdy"); 60 | var jobj = new JObject(); 61 | jobj.Add("hello","lol"); 62 | jobj.Add("message",buf); 63 | jobj.Add("goodbye","gotcha"); 64 | 65 | var _args = new List { "jsonbuff" }; 66 | _args.Add(jobj); 67 | 68 | var data = Packet.Args2JArray(_args); 69 | 70 | var packet = new Packet() 71 | { 72 | Type = Parser.BINARY_EVENT, 73 | Id = 999, 74 | Nsp = "/deep", 75 | Data = data 76 | }; 77 | Helpers.TestBin(packet); 78 | } 79 | 80 | 81 | // Cannot do any of the following in C# ??? 82 | //[Fact] 83 | //public void EncodeDeepBinaryJSONWithNullValue() 84 | //{ 85 | // var data = JObject.Parse("{a: \"b\", c: 4, e: {g: null}, h: null}"); 86 | // data["h"].Replace(new Byte[9]); 87 | 88 | // var packet = new Packet(Parser.BINARY_EVENT) 89 | // { 90 | // Id = 600, 91 | // Nsp = "/", 92 | // Data = data 93 | // }; 94 | // Helpers.TestBin(packet); 95 | //} 96 | 97 | //[Fact] 98 | //public void EncodeBinaryAckWithByteArray() 99 | //{ 100 | // var data = JArray.Parse("[a, null, {}]"); 101 | // data[1] = System.Text.Encoding.UTF8.GetBytes("xxx"); 102 | 103 | // var packet = new Packet(Parser.BINARY_ACK) 104 | // { 105 | // Id = 127, 106 | // Nsp = "/back", 107 | // Data = data 108 | // }; 109 | // Helpers.TestBin(packet); 110 | //} 111 | 112 | //[Fact] 113 | //public void CleanItselfUpOnClose() 114 | //{ 115 | 116 | // var packet = new Packet(Parser.ACK) 117 | // { 118 | // Id = 0, 119 | // Nsp = "/", 120 | // Data = System.Text.Encoding.UTF8.GetBytes("abc") 121 | // }; 122 | 123 | 124 | // Encoder.Encode(packet, new Parser.Encoder.CallbackImp((encodedPackets) => 125 | // { 126 | // var decoder = new Parser.Decoder(); 127 | // decoder.On(Parser.Decoder.EVENT_DECODED, new ListenerImpl((args) => 128 | // { 129 | // throw new Exception("received a packet when not all data was sent."); 130 | // })); 131 | 132 | // decoder.Add((string)encodedPackets[0]); 133 | // decoder.Add((byte[])encodedPackets[1]); 134 | // decoder.Destroy(); 135 | // Assert.Equal(0, decoder.Reconstructor.Buffers.Count); 136 | // })); 137 | 138 | 139 | } 140 | 141 | } 142 | 143 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ParserTests/Helpers.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using Quobject.EngineIoClientDotNet.ComponentEmitter; 3 | using Quobject.SocketIoClientDotNet.Parser; 4 | using System.Text; 5 | using Xunit; 6 | 7 | namespace SocketIoClientDotNet.Tests.ParserTests 8 | { 9 | public class Helpers 10 | { 11 | private static Parser.Encoder Encoder = new Parser.Encoder(); 12 | 13 | public static void Test(Packet obj) 14 | { 15 | Encoder.Encode(obj, new Parser.Encoder.CallbackImp((encodedPackets) => 16 | { 17 | var decoder = new Parser.Decoder(); 18 | decoder.On(Parser.Decoder.EVENT_DECODED, new ListenerImpl((data1) => 19 | { 20 | var packet = (Packet) data1; 21 | AssertPacket(obj, packet); 22 | })); 23 | decoder.Add((string)encodedPackets[0]); 24 | })); 25 | } 26 | 27 | public static void TestBin(Packet obj) 28 | { 29 | object originalData = obj.Data; 30 | Encoder.Encode(obj, new Parser.Encoder.CallbackImp((encodedPackets) => 31 | { 32 | var decoder = new Parser.Decoder(); 33 | decoder.On(Parser.Decoder.EVENT_DECODED, new ListenerImpl((args) => 34 | { 35 | var packet = (Packet) args; 36 | obj.Data = originalData; 37 | obj.Attachments = -1; 38 | AssertPacket(obj, packet); 39 | })); 40 | 41 | foreach (var packet in encodedPackets) 42 | { 43 | if (packet is string) 44 | { 45 | decoder.Add((string)packet); 46 | } else if (packet is byte[]) 47 | { 48 | decoder.Add((byte[])packet); 49 | } 50 | } 51 | })); 52 | } 53 | 54 | 55 | public static void AssertPacket(Packet expected, Packet actual) 56 | { 57 | Assert.Equal(expected.Type, actual.Type); 58 | Assert.Equal(expected.Id, actual.Id); 59 | Assert.Equal(expected.Nsp, actual.Nsp); 60 | Assert.Equal(expected.Attachments, actual.Attachments); 61 | 62 | if (expected.Data is JArray) 63 | { 64 | var exp = (JArray) expected.Data; 65 | var act = (JArray) expected.Data; 66 | Assert.Equal(exp.ToString(), act.ToString()); 67 | } 68 | else if (expected.Data is JObject) 69 | { 70 | var exp = (JObject) expected.Data; 71 | var act = (JObject) expected.Data; 72 | Assert.Equal(exp.ToString(), act.ToString()); 73 | } 74 | else 75 | { 76 | Assert.Equal(expected.Data.ToString(), actual.Data.ToString()); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/ParserTests/ParserTest.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using Quobject.EngineIoClientDotNet.ComponentEmitter; 3 | using Quobject.SocketIoClientDotNet.Parser; 4 | using Xunit; 5 | 6 | namespace SocketIoClientDotNet.Tests.ParserTests 7 | { 8 | public class ParserTest 9 | { 10 | [Fact] 11 | public void Decode() 12 | { 13 | var decoder = new Parser.Decoder(); 14 | var called = false; 15 | decoder.On(Parser.Decoder.EVENT_DECODED, new ListenerImpl((data1) => 16 | { 17 | called = true; 18 | 19 | })); 20 | decoder.Add("0/woot"); 21 | Assert.True(called); 22 | } 23 | 24 | 25 | [Fact] 26 | public void EncodeConnection() 27 | { 28 | var packet = new Packet(Parser.CONNECT) {Nsp = "/woot"}; 29 | Helpers.Test(packet); 30 | } 31 | 32 | [Fact] 33 | public void EncodeDisconnection() 34 | { 35 | var packet = new Packet(Parser.DISCONNECT) { Nsp = "/woot" }; 36 | Helpers.Test(packet); 37 | } 38 | 39 | [Fact] 40 | public void EncodeEvent() 41 | { 42 | 43 | //var packet = new Packet(Parser.EVENT) { Nsp = "/", Data = JArray.Parse("[\"a\", 1, {}]") }; 44 | //Helpers.Test(packet); 45 | 46 | //var packet2 = new Packet(Parser.EVENT) { Nsp = "/test", Data = JArray.Parse("[\"a\", 1, {}]") }; 47 | //Helpers.Test(packet2); 48 | 49 | } 50 | 51 | [Fact] 52 | public void EncodeAck() 53 | { 54 | //var packet = new Packet(Parser.ACK) {Id = 123 , Nsp = "/", Data = JArray.Parse("[\"a\", 1, {}]") }; 55 | //Helpers.Test(packet); 56 | } 57 | 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SocketIoClientDotNet")] 8 | [assembly: AssemblyDescription("Socket.IO Client Library for .Net")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Quobject Software")] 11 | [assembly: AssemblyProduct("SocketIoClientDotNet")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a95e75cd-35e6-4e88-9e22-631e3fd01546")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("0.9.12")] 35 | [assembly: AssemblyFileVersion("0.9.12")] 36 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/SocketIoClientDotNet.Tests.net45.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {EE298060-EB11-4787-804E-A1CB7EB2F597} 9 | Library 10 | Properties 11 | SocketIoClientDotNet.Tests 12 | SocketIoClientDotNet.Tests.net45 13 | v4.5 14 | 512 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\SocketIoClientDotNet.net45\packages\EngineIoClientDotNet.1.0.0.1-beta1\lib\net45\EngineIoClientDotNet.dll 38 | 39 | 40 | ..\SocketIoClientDotNet.net45\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 41 | 42 | 43 | ..\SocketIoClientDotNet.net45\packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net45\SuperSocket.ClientEngine.dll 44 | 45 | 46 | 47 | ..\SocketIoClientDotNet.net45\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ..\SocketIoClientDotNet.net45\packages\WebSocket4Net.0.15.0-beta9\lib\net45\WebSocket4Net.dll 58 | 59 | 60 | ..\SocketIoClientDotNet.net45\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll 61 | True 62 | 63 | 64 | ..\SocketIoClientDotNet.net45\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll 65 | True 66 | 67 | 68 | ..\SocketIoClientDotNet.net45\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll 69 | True 70 | 71 | 72 | ..\SocketIoClientDotNet.net45\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll 73 | True 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | {b4c79cee-4b09-428a-bfe9-b276df4f57fa} 94 | SocketIoClientDotNet.net45 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 107 | 108 | 109 | 110 | 117 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.net45/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.Tests.netstandard1.3/SocketIoClientDotNet.Tests.netstandard1.3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp1.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.mono/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SocketIoClientDotNet.mono")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SocketIoClientDotNet.mono")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ebf2fd3d-645f-408b-8595-ab81f67efeed")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.mono/SocketIoClientDotNet.mono.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9C663463-8A1D-4960-A64A-1E0303034FE2} 8 | Library 9 | Properties 10 | Quobject.SocketIoClientDotNet 11 | SocketIoClientDotNet 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | packages\EngineIoClientDotNet.0.9.18\lib\net45\EngineIoClientDotNet.dll 35 | True 36 | 37 | 38 | packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll 39 | True 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | packages\WebSocket4Net.0.12\lib\net45\WebSocket4Net.dll 51 | 52 | 53 | ..\..\References\xunit.dll 54 | 55 | 56 | 57 | 58 | Client\AckImpl.cs 59 | 60 | 61 | Client\IAck.cs 62 | 63 | 64 | Client\IO.cs 65 | 66 | 67 | Client\Manager.cs 68 | 69 | 70 | Client\On.cs 71 | 72 | 73 | Client\Socket.cs 74 | 75 | 76 | Client\SocketIOException.cs 77 | 78 | 79 | Client\Url.cs 80 | 81 | 82 | Modules\HasBinaryData.cs 83 | 84 | 85 | Parser\Binary.cs 86 | 87 | 88 | Parser\Packet.cs 89 | 90 | 91 | Parser\Parser.cs 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 106 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.mono/SocketIoClientDotNet.mono.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.mono", "SocketIoClientDotNet.mono.csproj", "{9C663463-8A1D-4960-A64A-1E0303034FE2}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.Tests.mono", "..\SocketIoClientDotNet.Tests.mono\SocketIoClientDotNet.Tests.mono.csproj", "{022DE7B5-7AA6-447A-8720-DDF627C384FD}" 9 | EndProject 10 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "grunt", "http://localhost:26409", "{78CADA8C-D36D-4887-8E24-665058A9D81A}" 11 | ProjectSection(WebsiteProperties) = preProject 12 | UseIISExpress = "true" 13 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 14 | Debug.AspNetCompiler.VirtualPath = "/localhost_26409" 15 | Debug.AspNetCompiler.PhysicalPath = "..\..\grunt\" 16 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 17 | Debug.AspNetCompiler.Updateable = "true" 18 | Debug.AspNetCompiler.ForceOverwrite = "true" 19 | Debug.AspNetCompiler.FixedNames = "false" 20 | Debug.AspNetCompiler.Debug = "True" 21 | Release.AspNetCompiler.VirtualPath = "/localhost_26409" 22 | Release.AspNetCompiler.PhysicalPath = "..\..\grunt\" 23 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 24 | Release.AspNetCompiler.Updateable = "true" 25 | Release.AspNetCompiler.ForceOverwrite = "true" 26 | Release.AspNetCompiler.FixedNames = "false" 27 | Release.AspNetCompiler.Debug = "False" 28 | SlnRelativePath = "..\..\grunt\" 29 | EndProjectSection 30 | EndProject 31 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "TestServer", "http://localhost:26412", "{7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}" 32 | ProjectSection(WebsiteProperties) = preProject 33 | UseIISExpress = "true" 34 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 35 | Debug.AspNetCompiler.VirtualPath = "/localhost_26412" 36 | Debug.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 37 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 38 | Debug.AspNetCompiler.Updateable = "true" 39 | Debug.AspNetCompiler.ForceOverwrite = "true" 40 | Debug.AspNetCompiler.FixedNames = "false" 41 | Debug.AspNetCompiler.Debug = "True" 42 | Release.AspNetCompiler.VirtualPath = "/localhost_26412" 43 | Release.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 44 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 45 | Release.AspNetCompiler.Updateable = "true" 46 | Release.AspNetCompiler.ForceOverwrite = "true" 47 | Release.AspNetCompiler.FixedNames = "false" 48 | Release.AspNetCompiler.Debug = "False" 49 | SlnRelativePath = "..\..\TestServer\" 50 | EndProjectSection 51 | EndProject 52 | Global 53 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 54 | Debug|Any CPU = Debug|Any CPU 55 | Release|Any CPU = Release|Any CPU 56 | EndGlobalSection 57 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 58 | {9C663463-8A1D-4960-A64A-1E0303034FE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {9C663463-8A1D-4960-A64A-1E0303034FE2}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {9C663463-8A1D-4960-A64A-1E0303034FE2}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {9C663463-8A1D-4960-A64A-1E0303034FE2}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {022DE7B5-7AA6-447A-8720-DDF627C384FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {022DE7B5-7AA6-447A-8720-DDF627C384FD}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {022DE7B5-7AA6-447A-8720-DDF627C384FD}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {022DE7B5-7AA6-447A-8720-DDF627C384FD}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 67 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.Build.0 = Debug|Any CPU 68 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.ActiveCfg = Debug|Any CPU 69 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.Build.0 = Debug|Any CPU 70 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 71 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.Build.0 = Debug|Any CPU 72 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.ActiveCfg = Debug|Any CPU 73 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.Build.0 = Debug|Any CPU 74 | EndGlobalSection 75 | GlobalSection(SolutionProperties) = preSolution 76 | HideSolutionNode = FALSE 77 | EndGlobalSection 78 | EndGlobal 79 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.mono/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/.vs/SocketIoClientDotNet.net35/v15/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/Src/SocketIoClientDotNet.net35/.vs/SocketIoClientDotNet.net35/v15/sqlite3/storage.ide -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/Collections.Concurrent/ConcurrentQueue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Quobject.SocketIoClientDotNet.Collections.Concurrent 7 | { 8 | public class ConcurrentQueue 9 | { 10 | private Queue m_Queue; 11 | 12 | private object m_SyncRoot = new object(); 13 | 14 | public int Count 15 | { 16 | get { return m_Queue.Count; } 17 | } 18 | 19 | 20 | public void Clear() 21 | { 22 | lock (m_SyncRoot) 23 | { 24 | m_Queue.Clear(); 25 | } 26 | } 27 | 28 | public List GetEnumerator() 29 | { 30 | lock (m_SyncRoot) 31 | { 32 | var result = new List(); 33 | foreach (var item in m_Queue) 34 | { 35 | result.Add((T)item); 36 | } 37 | return result; 38 | } 39 | } 40 | 41 | public ConcurrentQueue() 42 | { 43 | m_Queue = new Queue(); 44 | } 45 | 46 | public ConcurrentQueue(int capacity) 47 | { 48 | m_Queue = new Queue(capacity); 49 | } 50 | 51 | public ConcurrentQueue(IEnumerable collection) 52 | { 53 | m_Queue = new Queue(collection); 54 | } 55 | 56 | public void Enqueue(T item) 57 | { 58 | lock (m_SyncRoot) 59 | { 60 | m_Queue.Enqueue(item); 61 | } 62 | } 63 | 64 | public bool TryDequeue(out T item) 65 | { 66 | lock (m_SyncRoot) 67 | { 68 | if (m_Queue.Count <= 0) 69 | { 70 | item = default(T); 71 | return false; 72 | } 73 | 74 | item = m_Queue.Dequeue(); 75 | return true; 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SocketIoClientDotNet")] 8 | [assembly: AssemblyDescription("Socket.IO Client Library for .Net")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Quobject Software")] 11 | [assembly: AssemblyProduct("SocketIoClientDotNet")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a95e75cd-35e6-4e88-9e22-631e3fd01546")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.2")] 35 | [assembly: AssemblyFileVersion("1.0.2")] 36 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/SocketIoClientDotNet.net35.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0} 8 | Library 9 | Properties 10 | SocketIoClientDotNet 11 | SocketIoClientDotNet 12 | v3.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\net35\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | packages\EngineIoClientDotNet.1.0.2-beta1\lib\net35\EngineIoClientDotNet.dll 35 | 36 | 37 | packages\Newtonsoft.Json.9.0.1\lib\net35\Newtonsoft.Json.dll 38 | 39 | 40 | packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net35-client\SuperSocket.ClientEngine.dll 41 | 42 | 43 | 44 | 45 | False 46 | packages\System.Threading.Tasks.Unofficial.3.1\lib\net35\System.Threading.Tasks.NET35.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | packages\WebSocket4Net.0.15.0-beta9\lib\net35\WebSocket4Net.dll 54 | 55 | 56 | 57 | 58 | Client\AckImpl.cs 59 | 60 | 61 | Client\IAck.cs 62 | 63 | 64 | Client\IO_net35.cs 65 | 66 | 67 | Client\Manager_net35.cs 68 | 69 | 70 | Client\On.cs 71 | 72 | 73 | Client\SocketIOException.cs 74 | 75 | 76 | Client\Socket_net35.cs 77 | 78 | 79 | Client\Url.cs 80 | 81 | 82 | Modules\HasBinaryData.cs 83 | 84 | 85 | Parser\Binary.cs 86 | 87 | 88 | Parser\Packet.cs 89 | 90 | 91 | Parser\Parser.cs 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | Designer 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/SocketIoClientDotNet.net35.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.net35", "SocketIoClientDotNet.net35.csproj", "{E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.Tests.net35", "..\SocketIoClientDotNet.Tests.net35\SocketIoClientDotNet.Tests.net35.csproj", "{6D90EB17-A71E-4A5F-8BF1-1F7991AEB976}" 9 | EndProject 10 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "SocketIoClientDotNet", "..\..\", "{E62008C8-688A-49D1-90A7-D9BCFB0CC4C2}" 11 | ProjectSection(WebsiteProperties) = preProject 12 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 13 | Debug.AspNetCompiler.VirtualPath = "/localhost_9968" 14 | Debug.AspNetCompiler.PhysicalPath = "..\..\..\SocketIoClientDotNet\" 15 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_9968\" 16 | Debug.AspNetCompiler.Updateable = "true" 17 | Debug.AspNetCompiler.ForceOverwrite = "true" 18 | Debug.AspNetCompiler.FixedNames = "false" 19 | Debug.AspNetCompiler.Debug = "True" 20 | Release.AspNetCompiler.VirtualPath = "/localhost_9968" 21 | Release.AspNetCompiler.PhysicalPath = "..\..\..\SocketIoClientDotNet\" 22 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_9968\" 23 | Release.AspNetCompiler.Updateable = "true" 24 | Release.AspNetCompiler.ForceOverwrite = "true" 25 | Release.AspNetCompiler.FixedNames = "false" 26 | Release.AspNetCompiler.Debug = "False" 27 | VWDPort = "9968" 28 | SlnRelativePath = "..\..\..\SocketIoClientDotNet\" 29 | EndProjectSection 30 | EndProject 31 | Global 32 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 33 | Debug|Any CPU = Debug|Any CPU 34 | Release|Any CPU = Release|Any CPU 35 | EndGlobalSection 36 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 37 | {E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 38 | {E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU 39 | {E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU 40 | {E3D3A67D-9A1E-4915-8A2D-1C0E4447F5E0}.Release|Any CPU.Build.0 = Release|Any CPU 41 | {6D90EB17-A71E-4A5F-8BF1-1F7991AEB976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 42 | {6D90EB17-A71E-4A5F-8BF1-1F7991AEB976}.Debug|Any CPU.Build.0 = Debug|Any CPU 43 | {6D90EB17-A71E-4A5F-8BF1-1F7991AEB976}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {6D90EB17-A71E-4A5F-8BF1-1F7991AEB976}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {E62008C8-688A-49D1-90A7-D9BCFB0CC4C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 46 | {E62008C8-688A-49D1-90A7-D9BCFB0CC4C2}.Debug|Any CPU.Build.0 = Debug|Any CPU 47 | {E62008C8-688A-49D1-90A7-D9BCFB0CC4C2}.Release|Any CPU.ActiveCfg = Debug|Any CPU 48 | {E62008C8-688A-49D1-90A7-D9BCFB0CC4C2}.Release|Any CPU.Build.0 = Debug|Any CPU 49 | EndGlobalSection 50 | GlobalSection(SolutionProperties) = preSolution 51 | HideSolutionNode = FALSE 52 | EndGlobalSection 53 | EndGlobal 54 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net35/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/.vs/SocketIoClientDotNet.net40/v15/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/Src/SocketIoClientDotNet.net40/.vs/SocketIoClientDotNet.net40/v15/sqlite3/storage.ide -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SocketIoClientDotNet")] 8 | [assembly: AssemblyDescription("Socket.IO Client Library for .Net")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Quobject Software")] 11 | [assembly: AssemblyProduct("SocketIoClientDotNet")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a95e75cd-35e6-4e88-9e22-631e3fd01546")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.2")] 35 | [assembly: AssemblyFileVersion("1.0.2")] 36 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/SocketIoClientDotNet.net40.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {53AE4914-A35B-406C-91ED-7E3D9C950F45} 8 | Library 9 | Properties 10 | SocketIoClientDotNet 11 | SocketIoClientDotNet 12 | v4.0 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\net40\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | packages\EngineIoClientDotNet.1.0.2-beta1\lib\net40\EngineIoClientDotNet.dll 35 | 36 | 37 | packages\Newtonsoft.Json.9.0.1\lib\net40\Newtonsoft.Json.dll 38 | 39 | 40 | packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net40-client\SuperSocket.ClientEngine.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | packages\WebSocket4Net.0.15.0-beta9\lib\net40\WebSocket4Net.dll 51 | 52 | 53 | 54 | 55 | Collections.Concurrent\ConcurrentQueue.cs 56 | 57 | 58 | Client\AckImpl.cs 59 | 60 | 61 | Client\IAck.cs 62 | 63 | 64 | Client\IO_net35.cs 65 | 66 | 67 | Client\Manager_net35.cs 68 | 69 | 70 | Client\On.cs 71 | 72 | 73 | Client\SocketIOException.cs 74 | 75 | 76 | Client\Socket_net40.cs 77 | 78 | 79 | Client\Url.cs 80 | 81 | 82 | Modules\HasBinaryData.cs 83 | 84 | 85 | Parser\Binary.cs 86 | 87 | 88 | Parser\Packet.cs 89 | 90 | 91 | Parser\Parser.cs 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/SocketIoClientDotNet.net40.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.net40", "SocketIoClientDotNet.net40.csproj", "{53AE4914-A35B-406C-91ED-7E3D9C950F45}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.Tests.net40", "..\SocketIoClientDotNet.Tests.net40\SocketIoClientDotNet.Tests.net40.csproj", "{DD1A4F5E-5606-4989-9DF8-C1BBD50CD850}" 9 | EndProject 10 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "grunt", "http://localhost:26409", "{78CADA8C-D36D-4887-8E24-665058A9D81A}" 11 | ProjectSection(WebsiteProperties) = preProject 12 | UseIISExpress = "true" 13 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 14 | Debug.AspNetCompiler.VirtualPath = "/localhost_26409" 15 | Debug.AspNetCompiler.PhysicalPath = "..\..\grunt\" 16 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 17 | Debug.AspNetCompiler.Updateable = "true" 18 | Debug.AspNetCompiler.ForceOverwrite = "true" 19 | Debug.AspNetCompiler.FixedNames = "false" 20 | Debug.AspNetCompiler.Debug = "True" 21 | Release.AspNetCompiler.VirtualPath = "/localhost_26409" 22 | Release.AspNetCompiler.PhysicalPath = "..\..\grunt\" 23 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 24 | Release.AspNetCompiler.Updateable = "true" 25 | Release.AspNetCompiler.ForceOverwrite = "true" 26 | Release.AspNetCompiler.FixedNames = "false" 27 | Release.AspNetCompiler.Debug = "False" 28 | SlnRelativePath = "..\..\grunt\" 29 | EndProjectSection 30 | EndProject 31 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "TestServer", "http://localhost:26412", "{7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}" 32 | ProjectSection(WebsiteProperties) = preProject 33 | UseIISExpress = "true" 34 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 35 | Debug.AspNetCompiler.VirtualPath = "/localhost_26412" 36 | Debug.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 37 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 38 | Debug.AspNetCompiler.Updateable = "true" 39 | Debug.AspNetCompiler.ForceOverwrite = "true" 40 | Debug.AspNetCompiler.FixedNames = "false" 41 | Debug.AspNetCompiler.Debug = "True" 42 | Release.AspNetCompiler.VirtualPath = "/localhost_26412" 43 | Release.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 44 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 45 | Release.AspNetCompiler.Updateable = "true" 46 | Release.AspNetCompiler.ForceOverwrite = "true" 47 | Release.AspNetCompiler.FixedNames = "false" 48 | Release.AspNetCompiler.Debug = "False" 49 | SlnRelativePath = "..\..\TestServer\" 50 | EndProjectSection 51 | EndProject 52 | Global 53 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 54 | Debug|Any CPU = Debug|Any CPU 55 | Release|Any CPU = Release|Any CPU 56 | EndGlobalSection 57 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 58 | {53AE4914-A35B-406C-91ED-7E3D9C950F45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {53AE4914-A35B-406C-91ED-7E3D9C950F45}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {53AE4914-A35B-406C-91ED-7E3D9C950F45}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {53AE4914-A35B-406C-91ED-7E3D9C950F45}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {DD1A4F5E-5606-4989-9DF8-C1BBD50CD850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {DD1A4F5E-5606-4989-9DF8-C1BBD50CD850}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {DD1A4F5E-5606-4989-9DF8-C1BBD50CD850}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {DD1A4F5E-5606-4989-9DF8-C1BBD50CD850}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 67 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.Build.0 = Debug|Any CPU 68 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.ActiveCfg = Debug|Any CPU 69 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.Build.0 = Debug|Any CPU 70 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 71 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.Build.0 = Debug|Any CPU 72 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.ActiveCfg = Debug|Any CPU 73 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.Build.0 = Debug|Any CPU 74 | EndGlobalSection 75 | GlobalSection(SolutionProperties) = preSolution 76 | HideSolutionNode = FALSE 77 | EndGlobalSection 78 | EndGlobal 79 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net40/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/.vs/SocketIoClientDotNet.net45/v15/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/Src/SocketIoClientDotNet.net45/.vs/SocketIoClientDotNet.net45/v15/sqlite3/storage.ide -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/AckImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Quobject.SocketIoClientDotNet.Client 4 | { 5 | public class AckImpl : IAck 6 | { 7 | private readonly Action fn; 8 | private readonly Action fn1; 9 | private readonly Action fn2; 10 | private readonly Action fn3; 11 | 12 | public AckImpl(Action fn) 13 | { 14 | this.fn = fn; 15 | } 16 | 17 | public AckImpl(Action fn) 18 | { 19 | this.fn1 = fn; 20 | } 21 | public AckImpl(Action fn) 22 | { 23 | this.fn2 = fn; 24 | } 25 | 26 | public AckImpl(Action fn) 27 | { 28 | this.fn3 = fn; 29 | } 30 | 31 | 32 | public void Call(params object[] args) 33 | { 34 | if (fn != null) 35 | { 36 | fn(); 37 | } 38 | else if (fn1 != null) 39 | { 40 | var arg = args.Length > 0 ? args[0] : null; 41 | fn1(arg); 42 | } 43 | else if (fn2 != null) 44 | { 45 | var arg = args.Length > 0 ? args[0] : null; 46 | var arg1 = args.Length > 1 ? args[1] : null; 47 | fn2(arg, arg1); 48 | } 49 | else if (fn3 != null) 50 | { 51 | var arg = args.Length > 0 ? args[0] : null; 52 | var arg1 = args.Length > 1 ? args[1] : null; 53 | var arg2 = args.Length > 2 ? args[2] : null; 54 | fn3(arg, arg1, arg2); 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/IAck.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Quobject.SocketIoClientDotNet.Client 3 | { 4 | public interface IAck 5 | { 6 | void Call(params object[] args); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/IO.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using Quobject.EngineIoClientDotNet.Modules; 3 | using System; 4 | 5 | namespace Quobject.SocketIoClientDotNet.Client 6 | { 7 | public class IO 8 | { 9 | private static readonly ImmutableDictionary Managers = ImmutableDictionary.Create(); 10 | 11 | /// 12 | /// Protocol version 13 | /// 14 | public static int Protocol = Parser.Parser.protocol; 15 | 16 | private IO() 17 | { 18 | 19 | } 20 | 21 | public static Socket Socket(string uri) 22 | { 23 | return Socket(uri, null); 24 | } 25 | 26 | public static Socket Socket(string uri, Options opts) 27 | { 28 | return Socket(Url.Parse(uri), opts); 29 | } 30 | 31 | public static Socket Socket(Uri uri) 32 | { 33 | return Socket(uri, null); 34 | 35 | } 36 | public static Socket Socket(Uri uri, Options opts) 37 | { 38 | 39 | var log = LogManager.GetLogger(Global.CallerName()); 40 | if (opts == null) 41 | { 42 | opts = new Options(); 43 | } 44 | 45 | Manager io; 46 | 47 | if (opts.ForceNew || !opts.Multiplex) 48 | { 49 | log.Info(string.Format("ignoring socket cache for {0}", uri.ToString())); 50 | io = new Manager(uri, opts); 51 | } 52 | else 53 | { 54 | var id = Url.ExtractId(uri); 55 | if (!Managers.ContainsKey(id)) 56 | { 57 | log.Info( string.Format("new io instance for {0}", id)); 58 | Managers.Add(id, new Manager(uri, opts)); 59 | 60 | } 61 | io = Managers[id]; 62 | } 63 | return io.Socket(uri.PathAndQuery); 64 | } 65 | 66 | 67 | public class Options : Client.Options 68 | { 69 | 70 | public bool ForceNew = true; 71 | public bool Multiplex = true; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/IO_net35.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | using System.Collections.Concurrent; 4 | using Quobject.EngineIoClientDotNet.Modules; 5 | using System; 6 | 7 | namespace Quobject.SocketIoClientDotNet.Client 8 | { 9 | public class IO 10 | { 11 | private static readonly ConcurrentDictionary Managers = new ConcurrentDictionary(); 12 | 13 | /// 14 | /// Protocol version 15 | /// 16 | public static int Protocol = Parser.Parser.protocol; 17 | 18 | private IO() 19 | { 20 | 21 | } 22 | 23 | public static Socket Socket(string uri) 24 | { 25 | return Socket(uri, null); 26 | } 27 | 28 | public static Socket Socket(string uri, Options opts) 29 | { 30 | return Socket(Url.Parse(uri), opts); 31 | } 32 | 33 | public static Socket Socket(Uri uri) 34 | { 35 | return Socket(uri, null); 36 | 37 | } 38 | public static Socket Socket(Uri uri, Options opts) 39 | { 40 | 41 | var log = LogManager.GetLogger(Global.CallerName()); 42 | if (opts == null) 43 | { 44 | opts = new Options(); 45 | } 46 | 47 | Manager io; 48 | 49 | if (opts.ForceNew || !opts.Multiplex) 50 | { 51 | log.Info(string.Format("ignoring socket cache for {0}", uri.ToString())); 52 | io = new Manager(uri, opts); 53 | } 54 | else 55 | { 56 | var id = Url.ExtractId(uri); 57 | if (!Managers.ContainsKey(id)) 58 | { 59 | log.Info( string.Format("new io instance for {0}", id)); 60 | Managers.TryAdd(id, new Manager(uri, opts)); 61 | 62 | } 63 | io = Managers[id]; 64 | } 65 | return io.Socket(uri.PathAndQuery); 66 | } 67 | 68 | 69 | public class Options : Client.Options 70 | { 71 | 72 | public bool ForceNew = true; 73 | public bool Multiplex = true; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/On.cs: -------------------------------------------------------------------------------- 1 | using Quobject.EngineIoClientDotNet.ComponentEmitter; 2 | using System; 3 | 4 | namespace Quobject.SocketIoClientDotNet.Client 5 | { 6 | public class On 7 | { 8 | private On() { } 9 | 10 | public static IHandle Create(Emitter obj, string ev, IListener fn) 11 | { 12 | obj.On(ev, fn); 13 | return new HandleImpl(obj,ev,fn); 14 | } 15 | 16 | public class HandleImpl : IHandle 17 | { 18 | private Emitter obj; 19 | private string ev; 20 | private IListener fn; 21 | 22 | public HandleImpl(Emitter obj, string ev, IListener fn) 23 | { 24 | this.obj = obj; 25 | this.ev = ev; 26 | this.fn = fn; 27 | } 28 | 29 | public void Destroy() 30 | { 31 | obj.Off(ev, fn); 32 | } 33 | } 34 | 35 | public class ActionHandleImpl : IHandle 36 | { 37 | private Action fn; 38 | 39 | public ActionHandleImpl(Action fn) 40 | { 41 | this.fn = fn; 42 | } 43 | 44 | public void Destroy() 45 | { 46 | fn(); 47 | } 48 | } 49 | 50 | public interface IHandle 51 | { 52 | void Destroy(); 53 | } 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/SocketIOException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Quobject.SocketIoClientDotNet.Client 4 | { 5 | public class SocketIOException : Exception 6 | { 7 | public string Transport; 8 | public object code; 9 | 10 | public SocketIOException(string message) 11 | : base(message) 12 | { 13 | } 14 | 15 | 16 | public SocketIOException(Exception cause) 17 | : base("", cause) 18 | { 19 | } 20 | 21 | public SocketIOException(string message, Exception cause) 22 | : base(message, cause) 23 | { 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Client/Url.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Quobject.SocketIoClientDotNet.Client 4 | { 5 | public class Url 6 | { 7 | private Url() { } 8 | 9 | 10 | 11 | public static Uri Parse(string uri) 12 | { 13 | if (uri.StartsWith("//")) 14 | { 15 | uri = "http:" + uri; 16 | } 17 | 18 | var result = new Uri(uri); 19 | return result; 20 | 21 | } 22 | 23 | public static string ExtractId(string url) 24 | { 25 | return ExtractId(new Uri(url)); 26 | } 27 | 28 | public static string ExtractId(Uri uri) 29 | { 30 | var protocol = uri.Scheme; 31 | int port = uri.Port; 32 | if (port == -1) 33 | { 34 | if (uri.Scheme.StartsWith("https")) 35 | { 36 | port = 443; 37 | }else if (uri.Scheme.StartsWith("http")) 38 | { 39 | port = 80; 40 | } 41 | } 42 | 43 | return string.Format("{0}://{1}:{2}", protocol, uri.Host , port); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Modules/HasBinaryData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System.Linq; 3 | 4 | namespace Quobject.SocketIoClientDotNet.Modules 5 | { 6 | public static class HasBinaryData 7 | { 8 | public static bool HasBinary(object data) 9 | { 10 | return RecursiveCheckForBinary(data); 11 | } 12 | 13 | private static bool RecursiveCheckForBinary(object obj) 14 | { 15 | if (obj == null || obj is string) 16 | { 17 | return false; 18 | } 19 | 20 | if (obj is byte[]) 21 | { 22 | return true; 23 | } 24 | 25 | 26 | var array = obj as JArray; 27 | if (array != null) 28 | { 29 | if (array.Any(token => RecursiveCheckForBinary(token))) 30 | { 31 | return true; 32 | } 33 | } 34 | 35 | var jobject = obj as JObject; 36 | if (jobject != null) 37 | { 38 | if (jobject.Children().Any(child => RecursiveCheckForBinary(child))) 39 | { 40 | return true; 41 | } 42 | } 43 | 44 | var jvalue = obj as JValue; 45 | if (jvalue != null) 46 | { 47 | return RecursiveCheckForBinary(jvalue.Value); 48 | } 49 | 50 | var jprop = obj as JProperty; 51 | if (jprop != null) 52 | { 53 | return RecursiveCheckForBinary(jprop.Value); 54 | } 55 | 56 | return false; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Parser/Binary.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Quobject.SocketIoClientDotNet.Parser 6 | { 7 | public class Binary 8 | { 9 | private static readonly string KEY_PLACEHOLDER = "_placeholder"; 10 | 11 | private static readonly string KEY_NUM = "num"; 12 | 13 | public static DeconstructedPacket DeconstructPacket(Packet packet) 14 | { 15 | var buffers = new List(); 16 | 17 | packet.Data = _deconstructPacket(packet.Data, buffers); 18 | packet.Attachments = buffers.Count; 19 | 20 | var result = new DeconstructedPacket(); 21 | result.Packet = packet; 22 | result.Buffers = buffers.ToArray(); 23 | return result; 24 | } 25 | 26 | private static JToken _deconstructPacket(object data, List buffers) 27 | { 28 | if (data == null) 29 | { 30 | return null; 31 | } 32 | 33 | if (data is byte[]) 34 | { 35 | var byteArray = (byte[])data; 36 | return AddPlaceholder(buffers, byteArray); 37 | } 38 | 39 | var jToken = data as JToken; 40 | if (jToken == null) 41 | { 42 | throw new NotImplementedException(); 43 | } 44 | 45 | switch (jToken.Type) 46 | { 47 | case JTokenType.Object: 48 | var newJObject = new JObject(); 49 | var jObject = (JObject)jToken; 50 | foreach (var property in jObject.Properties()) 51 | { 52 | try 53 | { 54 | newJObject[property.Name] = _deconstructPacket(property.Value, buffers); 55 | } 56 | catch (Exception) 57 | { 58 | return null; 59 | } 60 | } 61 | return newJObject; 62 | 63 | case JTokenType.Array: 64 | var newJArray = new JArray(); 65 | var jArray = (JArray)jToken; 66 | for (int i = 0; i < jArray.Count; i++) 67 | { 68 | try 69 | { 70 | newJArray.Add(_deconstructPacket(jArray[i], buffers)); 71 | } 72 | catch (Exception) 73 | { 74 | return null; 75 | } 76 | } 77 | return newJArray; 78 | 79 | case JTokenType.Bytes: 80 | var byteArray = jToken.Value(); 81 | return AddPlaceholder(buffers, byteArray); 82 | 83 | case JTokenType.None: 84 | case JTokenType.Constructor: 85 | case JTokenType.Property: 86 | case JTokenType.Comment: 87 | throw new NotImplementedException(); 88 | 89 | default: 90 | return jToken; 91 | } 92 | } 93 | 94 | private static JToken AddPlaceholder(List buffers, byte[] byteArray) 95 | { 96 | var placeholder = new JObject(); 97 | try 98 | { 99 | placeholder.Add(KEY_PLACEHOLDER, true); 100 | placeholder.Add(KEY_NUM, buffers.Count); 101 | } 102 | catch (Exception) 103 | { 104 | return null; 105 | } 106 | buffers.Add(byteArray); 107 | return placeholder; 108 | } 109 | 110 | public static Packet ReconstructPacket(Packet packet, byte[][] buffers) 111 | { 112 | packet.Data = _reconstructPacket(packet.Data, buffers); 113 | packet.Attachments = -1; 114 | return packet; 115 | } 116 | 117 | private static object _reconstructPacket(object data, byte[][] buffers) 118 | { 119 | //var t = data.GetType(); 120 | 121 | if (data is JValue) 122 | { 123 | var dataStr = data.ToString(); 124 | if (!dataStr.StartsWith("[") && !dataStr.StartsWith("{")) 125 | { 126 | // 127 | return dataStr; 128 | } 129 | var jdata = JToken.Parse(data.ToString()); 130 | if (jdata.SelectToken(KEY_PLACEHOLDER) != null) 131 | { 132 | var jpl = jdata[KEY_PLACEHOLDER]; 133 | var jnum = jdata[KEY_NUM]; 134 | if (jpl != null && jnum != null) 135 | { 136 | var placeholder = jpl.ToObject(); 137 | if (placeholder) 138 | { 139 | var num = jnum.ToObject(); 140 | return buffers[num]; 141 | } 142 | } 143 | } 144 | else 145 | { 146 | var recValue = _reconstructPacket(jdata, buffers); 147 | return recValue; 148 | } 149 | 150 | 151 | 152 | //jdata 153 | }else if (data is JArray) 154 | { 155 | var _data = (JArray)data; 156 | int len = _data.Count; 157 | var newData = new JArray(); 158 | for (int i = 0; i < len; i++) 159 | { 160 | try 161 | { 162 | var recValue = _reconstructPacket(_data[i], buffers); 163 | if (recValue is string) 164 | { 165 | //newData[i] = (string) recValue; 166 | newData.Add((string)recValue); 167 | } 168 | else if (recValue is byte[]) 169 | { 170 | newData.Add((byte[])recValue); 171 | } 172 | else if (recValue is JArray) 173 | { 174 | //newData[i] = (JArray) recValue; 175 | newData.Add((JArray)recValue); 176 | } 177 | else if (recValue is JObject) 178 | { 179 | //newData[i] = (JObject)recValue; 180 | newData.Add((JObject)recValue); 181 | } 182 | } 183 | catch (Exception) 184 | { 185 | return null; 186 | } 187 | } 188 | return newData; 189 | } 190 | if (!(data is JObject)) 191 | { 192 | return data; 193 | } 194 | 195 | var newData1 = new JObject(); 196 | var _data1 = (JObject)data; 197 | 198 | //if ((bool) _data1[KEY_PLACEHOLDER]) 199 | if (_data1.SelectToken(KEY_PLACEHOLDER) != null && (bool) _data1[KEY_PLACEHOLDER]) 200 | { 201 | var num = (int)_data1[KEY_NUM]; 202 | return num >= 0 && num < buffers.Length ? buffers[num] : null; 203 | } 204 | 205 | foreach (var property in _data1.Properties()) 206 | { 207 | try 208 | { 209 | var recValue = _reconstructPacket(property.Value, buffers); 210 | if (recValue is string) 211 | { 212 | newData1[property.Name] = (string)recValue; 213 | } 214 | else if (recValue is byte[]) 215 | { 216 | newData1[property.Name] = (byte[])recValue; 217 | } 218 | else if (recValue is JArray) 219 | { 220 | newData1[property.Name] = (JArray)recValue; 221 | } 222 | else if (recValue is JObject) 223 | { 224 | newData1[property.Name] = (JObject)recValue; 225 | } 226 | } 227 | catch (Exception) 228 | { 229 | return null; 230 | } 231 | } 232 | return newData1; 233 | } 234 | 235 | 236 | public class DeconstructedPacket 237 | { 238 | public Packet Packet; 239 | public byte[][] Buffers; 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Parser/Packet.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Quobject.SocketIoClientDotNet.Parser 6 | { 7 | public class Packet 8 | { 9 | public int Type = -1; 10 | public int Id = -1; 11 | public String Nsp; 12 | public T Data; 13 | public int Attachments; 14 | 15 | public Packet() { } 16 | 17 | public Packet(int type) 18 | { 19 | this.Type = type; 20 | } 21 | 22 | public Packet(int type, T data) 23 | { 24 | this.Type = type; 25 | this.Data = data; 26 | } 27 | } 28 | public class Packet 29 | { 30 | public int Type = -1; 31 | public int Id = -1; 32 | public String Nsp; 33 | public object Data; 34 | public int Attachments; 35 | 36 | public Packet() 37 | { } 38 | 39 | public Packet(int type) 40 | : this(type, data: JToken.Parse("{}")) 41 | { 42 | } 43 | 44 | public Packet(int type, object data) 45 | { 46 | this.Type = type; 47 | this.Data = data; 48 | } 49 | 50 | public override string ToString() 51 | { 52 | return string.Format("Type:{0} Id:{1} Nsp:{2} Data:{3} Attachments:{4}", Type, Id, Nsp, Data, Attachments); 53 | } 54 | 55 | public List GetDataAsList() 56 | { 57 | var jarray = Data is JArray ? (JArray)Data : JArray.Parse((string)((JValue)Data).Value); 58 | var args = new List(); 59 | foreach (var o in jarray) 60 | { 61 | if (o is JValue) 62 | { 63 | var jval = (JValue)o; 64 | if (jval != null) 65 | { 66 | args.Add(jval.Value); 67 | } 68 | } 69 | else if (o is JToken) 70 | { 71 | var jtoken = (JToken)o; 72 | if (jtoken != null) 73 | { 74 | args.Add(jtoken); 75 | //args.Add(jtoken.ToString(Formatting.None)); 76 | } 77 | } 78 | 79 | } 80 | return args; 81 | } 82 | 83 | public static JArray Args2JArray(IEnumerable _args) 84 | { 85 | var jsonArgs = new JArray(); 86 | foreach (var o in _args) 87 | { 88 | jsonArgs.Add(o); 89 | } 90 | return jsonArgs; 91 | } 92 | 93 | public static JArray Remove(JArray a, int pos) 94 | { 95 | var na = new JArray(); 96 | for (int i = 0; i < a.Count; i++) 97 | { 98 | if (i != pos) 99 | { 100 | var v = a[i]; 101 | na.Add(v); 102 | } 103 | } 104 | return na; 105 | } 106 | 107 | 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Parser/Parser.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using Quobject.EngineIoClientDotNet.ComponentEmitter; 3 | using Quobject.EngineIoClientDotNet.Modules; 4 | using Quobject.SocketIoClientDotNet.Client; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | 10 | namespace Quobject.SocketIoClientDotNet.Parser 11 | { 12 | public class Parser 13 | { 14 | public const int CONNECT = 0; 15 | public const int DISCONNECT = 1; 16 | public const int EVENT = 2; 17 | public const int ACK = 3; 18 | public const int ERROR = 4; 19 | public const int BINARY_EVENT = 5; 20 | public const int BINARY_ACK = 6; 21 | public const int protocol = 4; 22 | 23 | 24 | /// 25 | /// Packet types 26 | /// 27 | public static List types = new List() 28 | { 29 | "CONNECT", 30 | "DISCONNECT", 31 | "EVENT", 32 | "BINARY_EVENT", 33 | "ACK", 34 | "BINARY_ACK", 35 | "ERROR" 36 | }; 37 | 38 | private Parser() { } 39 | 40 | private static Packet ErrorPacket = new Packet(ERROR, "parser error"); 41 | 42 | public class Encoder 43 | { 44 | public Encoder() { } 45 | 46 | public interface ICallback 47 | { 48 | void Call(object[] data); 49 | } 50 | 51 | 52 | public void Encode(Packet obj, ICallback callback) 53 | { 54 | var log = LogManager.GetLogger(Global.CallerName()); 55 | log.Info(string.Format("encoding packet {0}", obj)); 56 | 57 | if (BINARY_EVENT == obj.Type || BINARY_ACK == obj.Type) 58 | { 59 | EncodeAsBinary(obj, callback); 60 | } 61 | else 62 | { 63 | String encoding = EncodeAsString(obj); 64 | callback.Call(new object[] { encoding }); 65 | } 66 | } 67 | 68 | private string EncodeAsString(Packet obj) 69 | { 70 | var str = new StringBuilder(); 71 | bool nsp = false; 72 | 73 | str.Append(obj.Type); 74 | 75 | if (BINARY_EVENT == obj.Type || BINARY_ACK == obj.Type) 76 | { 77 | str.Append(obj.Attachments); 78 | str.Append("-"); 79 | } 80 | 81 | if (!string.IsNullOrEmpty(obj.Nsp) && !"/".Equals(obj.Nsp)) 82 | { 83 | nsp = true; 84 | str.Append(obj.Nsp); 85 | } 86 | 87 | if (obj.Id >= 0) 88 | { 89 | if (nsp) 90 | { 91 | str.Append(","); 92 | nsp = false; 93 | } 94 | str.Append(obj.Id); 95 | } 96 | 97 | if (obj.Data != null) 98 | { 99 | if (nsp) str.Append(","); 100 | str.Append(obj.Data); 101 | } 102 | 103 | var log = LogManager.GetLogger(Global.CallerName()); 104 | log.Info(string.Format("encoded {0} as {1}", obj, str)); 105 | return str.ToString(); 106 | } 107 | 108 | private void EncodeAsBinary(Packet obj, ICallback callback) 109 | { 110 | Binary.DeconstructedPacket deconstruction = Binary.DeconstructPacket(obj); 111 | String pack = EncodeAsString(deconstruction.Packet); 112 | var buffers = new List(); 113 | foreach (var item in deconstruction.Buffers) 114 | { 115 | buffers.Add(item); 116 | } 117 | 118 | buffers.Insert(0, pack); 119 | callback.Call(buffers.ToArray()); 120 | } 121 | 122 | public class CallbackImp : ICallback 123 | { 124 | private readonly Action Fn; 125 | 126 | public CallbackImp(Action fn) 127 | { 128 | Fn = fn; 129 | } 130 | 131 | public void Call(object[] data) 132 | { 133 | Fn(data); 134 | } 135 | } 136 | } 137 | 138 | 139 | public class Decoder : Emitter 140 | { 141 | public const string EVENT_DECODED = "decoded"; 142 | 143 | /*package*/ 144 | public BinaryReconstructor Reconstructor = null; 145 | 146 | public Decoder() 147 | { 148 | 149 | } 150 | 151 | public void Add(string obj) 152 | { 153 | Packet packet = decodeString(obj); 154 | if (packet.Type == BINARY_EVENT || packet.Type == BINARY_ACK) 155 | { 156 | this.Reconstructor = new BinaryReconstructor(packet); 157 | 158 | if (this.Reconstructor.reconPack.Attachments == 0) 159 | { 160 | this.Emit(EVENT_DECODED, packet); 161 | } 162 | } 163 | else 164 | { 165 | this.Emit(EVENT_DECODED, packet); 166 | } 167 | } 168 | 169 | 170 | public void Add(byte[] obj) 171 | { 172 | if (this.Reconstructor == null) 173 | { 174 | throw new SocketIOException("got binary data when not reconstructing a packet"); 175 | } 176 | else 177 | { 178 | var packet = this.Reconstructor.TakeBinaryData(obj); 179 | if (packet != null) 180 | { 181 | this.Reconstructor = null; 182 | this.Emit(EVENT_DECODED, packet); 183 | } 184 | } 185 | } 186 | 187 | private Packet decodeString(string str) 188 | { 189 | Packet p = new Packet(); 190 | int i = 0; 191 | 192 | p.Type = int.Parse(str.Substring(0,1)); 193 | if (p.Type < 0 || p.Type > types.Count - 1) return ErrorPacket; 194 | 195 | if (BINARY_EVENT == p.Type || BINARY_ACK == p.Type) 196 | { 197 | StringBuilder attachments = new StringBuilder(); 198 | while (str.Substring(++i, 1) != "-") 199 | { 200 | attachments.Append(str.Substring(i, 1)); 201 | } 202 | p.Attachments = int.Parse(attachments.ToString()); 203 | } 204 | 205 | if (str.Length > i + 1 && "/" == str.Substring(i+1, 1)) 206 | { 207 | var nsp = new StringBuilder(); 208 | while (true) 209 | { 210 | ++i; 211 | string c = str.Substring(i, 1); 212 | if ("," == c) 213 | { 214 | break; 215 | } 216 | nsp.Append(c); 217 | if (i + 1 == str.Length) 218 | { 219 | break; 220 | } 221 | } 222 | p.Nsp = nsp.ToString(); 223 | } 224 | else 225 | { 226 | p.Nsp = "/"; 227 | } 228 | 229 | var next = (i + 1) >= str.Length ? null : str.Substring(i + 1, 1); 230 | 231 | int unused; 232 | if (null != next && int.TryParse(next, out unused)) 233 | { 234 | var id = new StringBuilder(); 235 | while (true) 236 | { 237 | ++i; 238 | var c = str.Substring(i, 1); 239 | 240 | if (!int.TryParse(c, out unused)) 241 | { 242 | --i; 243 | break; 244 | } 245 | id.Append(c); 246 | if (i + 1 >= str.Length) 247 | { 248 | break; 249 | } 250 | } 251 | p.Id = int.Parse(id.ToString()); 252 | } 253 | 254 | 255 | if (i++ < str.Length) 256 | { 257 | try 258 | { 259 | var t = str.Substring(i); 260 | p.Data = new JValue(t); 261 | } 262 | catch (ArgumentOutOfRangeException) 263 | { 264 | // do nothing 265 | } 266 | catch (Exception) 267 | { 268 | return ErrorPacket; 269 | } 270 | } 271 | var log = LogManager.GetLogger(Global.CallerName()); 272 | log.Info(string.Format("decoded {0} as {1}", str, p)); 273 | return p; 274 | } 275 | 276 | public void Destroy() 277 | { 278 | if (Reconstructor != null) 279 | { 280 | Reconstructor.FinishReconstruction(); 281 | } 282 | } 283 | 284 | 285 | } 286 | 287 | /*package*/ 288 | public class BinaryReconstructor 289 | { 290 | 291 | public Packet reconPack; 292 | 293 | /*package*/ 294 | public List Buffers; 295 | 296 | public BinaryReconstructor(Packet packet) 297 | { 298 | this.reconPack = packet; 299 | this.Buffers = new List(); 300 | } 301 | 302 | public Packet TakeBinaryData(byte[] binData) 303 | { 304 | this.Buffers.Add(binData); 305 | if (this.Buffers.Count == this.reconPack.Attachments) 306 | { 307 | Packet packet = Binary.ReconstructPacket(this.reconPack, 308 | this.Buffers.ToArray()); 309 | this.FinishReconstruction(); 310 | return packet; 311 | } 312 | return null; 313 | } 314 | 315 | public void FinishReconstruction() 316 | { 317 | this.reconPack = null; 318 | this.Buffers = new List(); 319 | } 320 | } 321 | 322 | } 323 | } 324 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SocketIoClientDotNet")] 8 | [assembly: AssemblyDescription("Socket.IO Client Library for .Net")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Quobject Software")] 11 | [assembly: AssemblyProduct("SocketIoClientDotNet")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a95e75cd-35e6-4e88-9e22-631e3fd01546")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.2")] 35 | [assembly: AssemblyFileVersion("1.0.2")] 36 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/SocketIoClientDotNet.net45.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B4C79CEE-4B09-428A-BFE9-B276DF4F57FA} 8 | Library 9 | Properties 10 | Quobject.SocketIoClientDotNet 11 | SocketIoClientDotNet 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\net45\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | packages\EngineIoClientDotNet.1.0.2-beta1\lib\net45\EngineIoClientDotNet.dll 35 | 36 | 37 | packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | packages\SuperSocket.ClientEngine.Core.0.8.0.12\lib\net45\SuperSocket.ClientEngine.dll 41 | 42 | 43 | 44 | packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll 45 | 46 | 47 | 48 | 49 | packages\WebSocket4Net.0.15.0-beta9\lib\net45\WebSocket4Net.dll 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 79 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/SocketIoClientDotNet.net45.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.net45", "SocketIoClientDotNet.net45.csproj", "{B4C79CEE-4B09-428A-BFE9-B276DF4F57FA}" 7 | EndProject 8 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "grunt", "http://localhost:26409", "{78CADA8C-D36D-4887-8E24-665058A9D81A}" 9 | ProjectSection(WebsiteProperties) = preProject 10 | UseIISExpress = "true" 11 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 12 | Debug.AspNetCompiler.VirtualPath = "/localhost_26409" 13 | Debug.AspNetCompiler.PhysicalPath = "..\..\grunt\" 14 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 15 | Debug.AspNetCompiler.Updateable = "true" 16 | Debug.AspNetCompiler.ForceOverwrite = "true" 17 | Debug.AspNetCompiler.FixedNames = "false" 18 | Debug.AspNetCompiler.Debug = "True" 19 | Release.AspNetCompiler.VirtualPath = "/localhost_26409" 20 | Release.AspNetCompiler.PhysicalPath = "..\..\grunt\" 21 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26409\" 22 | Release.AspNetCompiler.Updateable = "true" 23 | Release.AspNetCompiler.ForceOverwrite = "true" 24 | Release.AspNetCompiler.FixedNames = "false" 25 | Release.AspNetCompiler.Debug = "False" 26 | SlnRelativePath = "..\..\grunt\" 27 | EndProjectSection 28 | EndProject 29 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "TestServer", "http://localhost:26412", "{7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}" 30 | ProjectSection(WebsiteProperties) = preProject 31 | UseIISExpress = "true" 32 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 33 | Debug.AspNetCompiler.VirtualPath = "/localhost_26412" 34 | Debug.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 35 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 36 | Debug.AspNetCompiler.Updateable = "true" 37 | Debug.AspNetCompiler.ForceOverwrite = "true" 38 | Debug.AspNetCompiler.FixedNames = "false" 39 | Debug.AspNetCompiler.Debug = "True" 40 | Release.AspNetCompiler.VirtualPath = "/localhost_26412" 41 | Release.AspNetCompiler.PhysicalPath = "..\..\TestServer\" 42 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_26412\" 43 | Release.AspNetCompiler.Updateable = "true" 44 | Release.AspNetCompiler.ForceOverwrite = "true" 45 | Release.AspNetCompiler.FixedNames = "false" 46 | Release.AspNetCompiler.Debug = "False" 47 | SlnRelativePath = "..\..\TestServer\" 48 | EndProjectSection 49 | EndProject 50 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.Tests.net45", "..\SocketIoClientDotNet.Tests.net45\SocketIoClientDotNet.Tests.net45.csproj", "{EE298060-EB11-4787-804E-A1CB7EB2F597}" 51 | EndProject 52 | Global 53 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 54 | Debug|Any CPU = Debug|Any CPU 55 | Release|Any CPU = Release|Any CPU 56 | EndGlobalSection 57 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 58 | {B4C79CEE-4B09-428A-BFE9-B276DF4F57FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {B4C79CEE-4B09-428A-BFE9-B276DF4F57FA}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {B4C79CEE-4B09-428A-BFE9-B276DF4F57FA}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {B4C79CEE-4B09-428A-BFE9-B276DF4F57FA}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.ActiveCfg = Debug|Any CPU 65 | {78CADA8C-D36D-4887-8E24-665058A9D81A}.Release|Any CPU.Build.0 = Debug|Any CPU 66 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 67 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Debug|Any CPU.Build.0 = Debug|Any CPU 68 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.ActiveCfg = Debug|Any CPU 69 | {7EF7CD07-6799-4D20-B19F-DD7CE58B5E30}.Release|Any CPU.Build.0 = Debug|Any CPU 70 | {EE298060-EB11-4787-804E-A1CB7EB2F597}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 71 | {EE298060-EB11-4787-804E-A1CB7EB2F597}.Debug|Any CPU.Build.0 = Debug|Any CPU 72 | {EE298060-EB11-4787-804E-A1CB7EB2F597}.Release|Any CPU.ActiveCfg = Release|Any CPU 73 | {EE298060-EB11-4787-804E-A1CB7EB2F597}.Release|Any CPU.Build.0 = Release|Any CPU 74 | EndGlobalSection 75 | GlobalSection(SolutionProperties) = preSolution 76 | HideSolutionNode = FALSE 77 | EndGlobalSection 78 | EndGlobal 79 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.net45/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.netstandard1.3/.vs/SocketIoClientDotNet.netstandard1.3/v15/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/Src/SocketIoClientDotNet.netstandard1.3/.vs/SocketIoClientDotNet.netstandard1.3/v15/sqlite3/storage.ide -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.netstandard1.3/SocketIoClientDotNet.netstandard1.3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | Quobject.SocketIoClientDotNet 6 | SocketIoClientDotNet 7 | 1.0.2.0 8 | 1.0.2.0 9 | 1.0.2-beta1 10 | True 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Src/SocketIoClientDotNet.netstandard1.3/SocketIoClientDotNet.netstandard1.3.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.netstandard1.3", "SocketIoClientDotNet.netstandard1.3.csproj", "{C8597B7D-FB47-4E8C-B6CC-F6A1A7EB4A66}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIoClientDotNet.Tests.netstandard1.3", "..\SocketIoClientDotNet.Tests.netstandard1.3\SocketIoClientDotNet.Tests.netstandard1.3.csproj", "{8C547F34-1594-4185-85CC-2FAB00867912}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C8597B7D-FB47-4E8C-B6CC-F6A1A7EB4A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {C8597B7D-FB47-4E8C-B6CC-F6A1A7EB4A66}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {C8597B7D-FB47-4E8C-B6CC-F6A1A7EB4A66}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {C8597B7D-FB47-4E8C-B6CC-F6A1A7EB4A66}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {8C547F34-1594-4185-85CC-2FAB00867912}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {8C547F34-1594-4185-85CC-2FAB00867912}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {8C547F34-1594-4185-85CC-2FAB00867912}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {8C547F34-1594-4185-85CC-2FAB00867912}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /TestServer/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test.xml 3 | *.pem 4 | -------------------------------------------------------------------------------- /TestServer/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "devel": true, 4 | "indent": 2, 5 | "maxerr": 50, 6 | "newcap": true, 7 | "nomen": true, 8 | "plusplus": false, 9 | "regexp": true, 10 | "white": false, 11 | "curly": true, 12 | "eqnull": true, 13 | "eqeqeq": true, 14 | "undef": true 15 | 16 | } -------------------------------------------------------------------------------- /TestServer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Socket.IO chat 5 | 15 | 16 | 17 |
    18 |
    19 | 20 |
    21 | 22 | 23 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /TestServer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "socket.io-client.testserver", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "express": "^4.15.2", 7 | "socket.io": "^1.7.3", 8 | "expect": "^1.20.2", 9 | "expect.js": "^0.3.1", 10 | "utf8": "^2.1.2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TestServer/server.js: -------------------------------------------------------------------------------- 1 | var 2 | ssl = true, 3 | express = require('express'), 4 | expect = require('expect.js'), 5 | util = require('util'), 6 | config = require('./../grunt/config.json'), 7 | test_data = require('./test_data.json'), 8 | utf8 = require('utf8'), 9 | app = express(), 10 | fs = require('fs'), 11 | options = { 12 | key: fs.readFileSync(__dirname + '/testme.quobject.com.key'), 13 | cert: fs.readFileSync(__dirname + '/testme.quobject.com.cert'), 14 | requestCert: true 15 | }, 16 | io, 17 | io_ssl, 18 | https, 19 | http, 20 | slice = Array.prototype.slice; 21 | 22 | 23 | console.log("https port = " + config.server.ssl_port); 24 | https = require('https').createServer(options, app); 25 | io_ssl = require('socket.io')(https, { pingInterval: 500 }); 26 | https.listen(config.server.ssl_port, function (d) { 27 | console.log('socket.io server listening on port', config.server.ssl_port); 28 | }); 29 | 30 | console.log("http port = " + config.server.port); 31 | http = require('http').createServer(app); 32 | io = require('socket.io')(http, { pingInterval: 500 }); 33 | http.listen(config.server.port, function () { 34 | console.log('socket.io server listening on port', config.server.port); 35 | }); 36 | 37 | app.get('/', function (req, res) { 38 | res.sendfile('index.html'); 39 | }); 40 | 41 | io.on('connection', function(socket) { 42 | socket.emit('hi', 'more data'); 43 | 44 | socket.on('hi2', function(d) { 45 | 46 | console.log("hi2" + d); 47 | socket.emit('hi2back', 'more data'); 48 | }); 49 | 50 | // simple test 51 | socket.on('hi', function(d) { 52 | console.log("hi" + d); 53 | socket.emit('hi', 'more data'); 54 | }); 55 | 56 | //ogs test 57 | socket.on('parser_error#21', function(d) { 58 | console.log("ogs test" + d); 59 | socket.emit('parser_error#21_response', test_data.ogstestchars); 60 | }); 61 | 62 | socket.on('d10000chars', function() { 63 | console.log('d10000chars'); 64 | socket.emit('d10000chars', test_data.d10000chars); 65 | }); 66 | 67 | 68 | socket.on('d100000chars', function() { 69 | console.log('d100000chars'); 70 | socket.emit('d100000chars', test_data.d100000chars); 71 | }); 72 | 73 | 74 | socket.on('json10000chars', function() { 75 | console.log('json10000chars'); 76 | socket.emit('json10000chars', { data: test_data.d10000chars }); 77 | }); 78 | 79 | socket.on('json10000000chars', function() { 80 | console.log('json10000000chars'); 81 | socket.emit('json10000000chars', { 82 | data: test_data.d10000000chars, 83 | data2: test_data.d100000chars, 84 | data3: test_data.d100000chars, 85 | data4: { data5: test_data.d100000chars } 86 | }); 87 | }); 88 | 89 | 90 | socket.on('latin', function(wsinput) { 91 | console.log('issue24 socket.on latin'); 92 | socket.emit('latin', { 'error': 'Nombre de usuario o contraseña incorrecta.' }); 93 | }); 94 | 95 | socket.on('nolatin', function(wsinput) { 96 | console.log('issue24 sockect.on no latin'); 97 | socket.emit('nolatin', { 'error': 'Nombre de usuario o contrasena incorrecta.' }); 98 | }); 99 | 100 | socket.on('get_cookie', function() { 101 | console.log(util.inspect(socket.handshake.headers.cookie)); 102 | socket.emit('got_cookie', socket.handshake.headers.cookie); 103 | }); 104 | 105 | // ack tests 106 | socket.on('ack', function() { 107 | socket.emit('ack', function(a, b) { 108 | console.log("emit ack b=" + JSON.stringify(b)); 109 | if (a === 5 && b.b === true) { 110 | socket.emit('got it'); 111 | } 112 | }); 113 | }); 114 | 115 | socket.on('ack2', function() { 116 | socket.emit('ack2', 'hello there', function(a, b) { 117 | console.log("emit ack2 b=" + JSON.stringify(b)); 118 | if (a === 5 && b.b === true) { 119 | socket.emit('got it'); 120 | } 121 | }); 122 | }); 123 | 124 | socket.on('getAckDate', function(data, cb) { 125 | cb(new Date(), 5); 126 | }); 127 | 128 | socket.on('getDate', function() { 129 | socket.emit('takeDate', new Date()); 130 | }); 131 | 132 | socket.on('getDateObj', function() { 133 | socket.emit('takeDateObj', { date: new Date() }); 134 | }); 135 | 136 | socket.on('getUtf8', function() { 137 | socket.emit('takeUtf8', 'てすと'); 138 | socket.emit('takeUtf8', 'Я Б Г Д Ж Й'); 139 | socket.emit('takeUtf8', 'Ä ä Ü ü ß'); 140 | socket.emit('takeUtf8', '李O四'); 141 | socket.emit('takeUtf8', 'utf8 — string'); 142 | }); 143 | 144 | // false test 145 | socket.on('false', function() { 146 | socket.emit('false', false); 147 | }); 148 | 149 | // binary test 150 | socket.on('doge', function() { 151 | var buf = new Buffer('asdfasdf', 'utf8'); 152 | socket.emit('doge', buf); 153 | }); 154 | 155 | // expect receiving binary to be buffer 156 | socket.on('buffa', function(a) { 157 | if (Buffer.isBuffer(a)) { 158 | socket.emit('buffack'); 159 | } 160 | }); 161 | 162 | // expect receiving binary with mixed JSON 163 | socket.on('jsonbuff', function(a) { 164 | expect(a.hello).to.eql('lol'); 165 | expect(Buffer.isBuffer(a.message)).to.be(true); 166 | expect(a.goodbye).to.eql('gotcha'); 167 | socket.emit('jsonbuff-ack'); 168 | }); 169 | 170 | // expect receiving buffers in order 171 | var receivedAbuff1 = false; 172 | socket.on('abuff1', function(a) { 173 | expect(Buffer.isBuffer(a)).to.be(true); 174 | receivedAbuff1 = true; 175 | }); 176 | socket.on('abuff2', function(a) { 177 | expect(receivedAbuff1).to.be(true); 178 | socket.emit('abuff2-ack'); 179 | }); 180 | 181 | // emit buffer to base64 receiving browsers 182 | socket.on('getbin', function() { 183 | var buf = new Buffer('asdfasdf', 'utf8'); 184 | socket.emit('takebin', buf); 185 | }); 186 | 187 | // simple test 188 | socket.on('test', function(d) { 189 | var s1 = "test" + d; 190 | console.log(s1); 191 | fs.appendFileSync('test.txt', s1); 192 | socket.emit('hi', 'more data'); 193 | }); 194 | 195 | }); 196 | 197 | io.of('/foo').on('connection', function () { 198 | // register namespace 199 | }); 200 | 201 | io.of('/timeout_socket').on('connection', function () { 202 | // register namespace 203 | }); 204 | 205 | io.of('/valid').on('connection', function () { 206 | // register namespace 207 | }); 208 | 209 | io.of('/asd').on('connection', function () { 210 | // register namespace 211 | }); 212 | 213 | io_ssl.on('connection', function (socket) { 214 | 215 | }); 216 | 217 | -------------------------------------------------------------------------------- /TestServer/test.txt: -------------------------------------------------------------------------------- 1 | testcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקהtestcsdataてすとבדיקה -------------------------------------------------------------------------------- /TestServer/testme.quobject.com.cert: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDDzCCAfegAwIBAgIJANW6WUwZpQs+MA0GCSqGSIb3DQEBBQUAMB4xHDAaBgNV 3 | BAMME3Rlc3RtZS5xdW9iamVjdC5jb20wHhcNMTQwODI2MTkwMDQzWhcNMjQwODIz 4 | MTkwMDQzWjAeMRwwGgYDVQQDDBN0ZXN0bWUucXVvYmplY3QuY29tMIIBIjANBgkq 5 | hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtJCU+74bnPPYg0SPBCws1WYdT7+lXDaf 6 | IZdCLXU3RT/hAszD/Hi8oCijD1BvfjRcPr9XAqKBWMeLTorV8YL/I5g+5Nzmcaep 7 | LjnmQV3YDR+ioBfx+PRwF8gx/ZGdmK/hcoFq27xbF6cLI4mbvddlwUdKEGgZ+g/a 8 | B+CzFF9xCKoll6zqnnHS+DImGNbH4+ex33vQj4yoQrRT5E85s7/nSwvbDve+AlJ3 9 | ChJVod4kepwixhV90ENP0u65lpgi7ipIDCNxtf/7ZazsSj33eSKioz3xy2mFX7WO 10 | Fqtg1f3h/njH4uI6RkPUbuFyj3IOqv6OQwbl7NXbzuPfkmGC7QBGqwIDAQABo1Aw 11 | TjAdBgNVHQ4EFgQUE28o7tGA1Aw53KhiC0PyTDlA29EwHwYDVR0jBBgwFoAUE28o 12 | 7tGA1Aw53KhiC0PyTDlA29EwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC 13 | AQEAqbOxXwelUcV9psZl8fr+FIbkl5/mLqZV1RdrHCkUD2OwGH5M8AlCqj42hmxi 14 | n6KIgE45MOo9UYHWNQ1Aem3ziEGPRDVZpsoNW1GfG6XnAH5r1DK34Td7lU1JebNN 15 | hxqV3AfVfeqrW1ZOmqEFJ95VwCoN1RPPh3MgFI1zjOjEJyk0pPxFNFRtpIHfLgve 16 | TFe88aVMAbDLVzGyDkkS2DxNvyZ5153W3JRh2u8PqhLSzCIGF+IcCOrwZya+VC63 17 | wWg8AckPXIGmhU/6P4zdQ/WCZ/tqErFYls49zwp6xAfvvfdTbqYCSNyOqsTKbYyP 18 | qAd5L9YKITYYa8IupRyIJGbXnw== 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /TestServer/testme.quobject.com.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAtJCU+74bnPPYg0SPBCws1WYdT7+lXDafIZdCLXU3RT/hAszD 3 | /Hi8oCijD1BvfjRcPr9XAqKBWMeLTorV8YL/I5g+5NzmcaepLjnmQV3YDR+ioBfx 4 | +PRwF8gx/ZGdmK/hcoFq27xbF6cLI4mbvddlwUdKEGgZ+g/aB+CzFF9xCKoll6zq 5 | nnHS+DImGNbH4+ex33vQj4yoQrRT5E85s7/nSwvbDve+AlJ3ChJVod4kepwixhV9 6 | 0ENP0u65lpgi7ipIDCNxtf/7ZazsSj33eSKioz3xy2mFX7WOFqtg1f3h/njH4uI6 7 | RkPUbuFyj3IOqv6OQwbl7NXbzuPfkmGC7QBGqwIDAQABAoIBAQCy2/0YGUqVAF7a 8 | ONFKGtAWWt5yHq6YV2ruBT0CdnfXWt1yvo7sylReeaJ8CvtGEmvFpBd2fq6N2Ku/ 9 | k3s1jsNY6Ph0D/UdZC0Lo0LYQTNAXLPkzZNdPhTDGgWa3eE0XBSALn5BR6UcGtXH 10 | 0Am71V/wQsO02MnSkF0zLHt3lMsM/oPoJx8S6Tw+PpxGOhwQipdLMjKH49vyy5IM 11 | pS5OiGuAjmIq7bB0QPbgeZkQgSVgvZ+XP4OLuRt7I6GwMnChrVucybYWuetTSoUI 12 | uyRmOtlwUFBVJdSwEY5RfdF71kOH9DPpuTY6M4UJGdprEM1N1dX0WF2y/5D+ExeA 13 | rb06SXrxAoGBANfSja+YFn5+M8N/favt2/nGP6ePQJutjeiz0PgYOpe/85MrqNK/ 14 | 5rlU89QNDm616xEJnsPO/J/ZFDf+2rhuTfNCeNtzA/10j07xhHYN62Us9S5bsaXC 15 | JSMgdLcAnbUAXRJVrxPoUYgIoJIR65IG9UAHshoAysGPfBKQqR4hWKsHAoGBANYt 16 | wMnPA2sZH651pIe9lMETHeY5AIx7QGEDtu12raTgHaQanJFTXz5oXsEkJYUJKVvK 17 | XS2I74ZbIjvruASj2Tf7/L21xxo2JmxJCXVMlgyrVRKBIb9d0Ea7tUqLsIukYV3X 18 | iXrSabVtLLJA/SCtZME0tHrc/4RJwLIG0XVltMo9AoGARrQl0qbCh8IUdzFnHFIa 19 | RKOb6urVQasD2H5AMWbOmzQ5ObeN4S0ZCxI3pvp4BfD3B2fdaUyAGmXlZ8rIIK+S 20 | PeVC7rGpVvk+kaAxwvMgcM7fq8ZCVolZ3T4evm0nPUrXMtB7QMxVGXmqEPBp+jbp 21 | VYav5DDqO6sj/HkDzmkiQTUCgYEAxXMUonfITPmybWFjNwidlImNLOssCFav+UA1 22 | aiHY34EFkn4+DPPxgFUz1Zb/R/A0Qr0CvbHaL+DgZKFg2lY7MROL41Erpox5S6bh 23 | o1PhmPhyy0Zk2Ekic7Mk5P522aXHZX4I7kQA1BM7+3FSasevdTajlAkdPtXHYdhL 24 | TZFf5HkCgYB4qGARdPa0JJ+YbNilsykkIKs602Faen7qR1uVYFzbM+GUOjMrHkxt 25 | mmLE4+IrkhrWKQTW4vDAlIvTBZYJYeXZtu0IRilKccSExcKDhBmWhIDyFqRoyl3V 26 | OYmrskNT5YtBTEFKerAOKJ5LXxVQQ7k2YDz3uSli3NNsCMpfqo7Lxg== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /TestServer/testme.quobject.com.p7b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/TestServer/testme.quobject.com.p7b -------------------------------------------------------------------------------- /grunt/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test.xml -------------------------------------------------------------------------------- /grunt/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "devel": true, 4 | "indent": 2, 5 | "maxerr": 50, 6 | "newcap": true, 7 | "nomen": true, 8 | "plusplus": false, 9 | "regexp": true, 10 | "white": false, 11 | "curly": true, 12 | "eqnull": true, 13 | "eqeqeq": true, 14 | "undef": true 15 | 16 | } -------------------------------------------------------------------------------- /grunt/Gruntfile.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function (grunt) { 3 | var 4 | node_os = require('os'), 5 | config = require('./config.json'), 6 | util = require('util'), 7 | os = node_os.platform() === 'win32' ? 'win' : 'linux', 8 | nuget_builds = [ 9 | { "Name": "SocketIoClientDotNet.net35", "NuGetDir": "net35", "SourceDir": "net35", copyOnly: true }, 10 | { "Name": "SocketIoClientDotNet.net40", "NuGetDir": "net40", "SourceDir": "net40", copyOnly: true }, 11 | { "Name": "SocketIoClientDotNet.net45", "NuGetDir": "net45", "SourceDir": "net45", copyOnly: true }, 12 | { "Name": "SocketIoClientDotNet.netstandard1.3", "NuGetDir": "netstandard1.3", "SourceDir": "netstandard1.3", "SourceFileName": "SocketIoClientDotNet.netstandard1.3.dll", copyOnly: true }, 13 | ]; 14 | 15 | grunt.log.writeln(util.inspect(config)); 16 | grunt.log.writeln( 'os = "%s"', os ); 17 | 18 | grunt.loadTasks('./tasks'); 19 | 20 | grunt.initConfig({ 21 | os: os, 22 | config: config, 23 | //msbuild_configuration: 'Debug', 24 | msbuild_configuration: 'Release', 25 | nuget_builds: nuget_builds, 26 | release_path: './../Releases/<%= config.version %>/', 27 | working_path: './../Working/', 28 | server_path: '../TestServer/', 29 | shell: { 30 | exec: { 31 | options: { 32 | stdout: true, 33 | stderr: true 34 | } 35 | } 36 | }, 37 | jshint: { 38 | options: { 39 | jshintrc: true, 40 | }, 41 | target: ['Gruntfile.js', '<%= server_path %>server.js', 'tasks/**/*.js'] 42 | }, 43 | clean: { 44 | release: ['<%= release_path %>/*'], 45 | working: ['<%= working_path %>/*'], 46 | options: { force: true } 47 | }, 48 | copy: { 49 | release: { 50 | files: [ 51 | { 52 | expand: true, 53 | cwd: './../SocketIoClientDotNet/bin/Release', 54 | src: '*', 55 | dest: '<%= release_path %>/net45' 56 | } 57 | ] 58 | }, 59 | release_mono: { 60 | files: [ 61 | { 62 | expand: true, 63 | cwd: './../SocketIoClientDotNet_Mono/bin/Release', 64 | src: '*', 65 | dest: '<%= release_path %>/mono' 66 | } 67 | ] 68 | }, 69 | } 70 | }); 71 | 72 | grunt.loadNpmTasks('grunt-contrib-copy'); 73 | grunt.loadNpmTasks('grunt-contrib-clean'); 74 | grunt.loadNpmTasks('grunt-shell'); 75 | grunt.loadNpmTasks('grunt-contrib-jshint'); 76 | grunt.registerTask('default', ['jshint', 'installNpm', 'nuget', 'buildClient', 'buildTest', 'startServer', 'testClient']); 77 | grunt.registerTask('test', ['jshint', 'buildClient', 'buildTest', 'testClient']); 78 | grunt.registerTask('makeNuget', ['jshint','clean:working','createNugetPackage']); 79 | grunt.registerTask('makeComponent', ['jshint','clean:working','createNugetPackage','createXamarinComponent']); 80 | }; 81 | -------------------------------------------------------------------------------- /grunt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"1.0.2", 3 | "server":{ 4 | "port":80, 5 | "ssl_port":443, 6 | "hostname":"127.0.0.1" 7 | }, 8 | "win":{ 9 | "powershell":"C:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe", 10 | "msbuild":"C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe", 11 | "xunit_path":"C:/Development/quobject.visualstudio.com/EngineIoClientDotNet/Src/EngineIoClientDotNet.net45/packages/xunit.runner.console.2.0.0/tools", 12 | "nuget":"C:/ProgramData/chocolatey/bin/NuGet.exe", 13 | "xamarin_component":"xamarin-component.exe" 14 | }, 15 | "linux":{ 16 | "msbuild":"xbuild", 17 | "xunit_path":"/home/apollo/vendors/xunit", 18 | "xamarin_component":"xamarin-component" 19 | } 20 | } -------------------------------------------------------------------------------- /grunt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SocketIoClientDotNet", 3 | "version": "0.10.0", 4 | "author": "Matthias Ludwig", 5 | "description": "Socket.IO Client Library for .Net", 6 | "repository": { 7 | "type": "git", 8 | "url": "" 9 | }, 10 | "readme": "This is the Socket.IO Client Library for C#, which is ported from the [JavaScript client](https://github.com/LearnBoost/engine.io-client).", 11 | "devDependencies": { 12 | "grunt": "^1.0.1", 13 | "grunt-shell": "^2.1.0", 14 | "grunt-contrib-jshint": "^1.1.0" 15 | }, 16 | "dependencies": { 17 | "string": "^3.3.3", 18 | "string-formatter": "^0.2.5", 19 | "grunt-contrib-clean": "^1.0.0", 20 | "grunt-contrib-copy": "^1.0.0", 21 | "rimraf": "^2.6.1", 22 | "express": "^4.15.2", 23 | "utf8": "^2.1.2" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /grunt/tasks/build-client.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('buildClient', 4 | 'build cs modules', function () { 5 | var 6 | fs = require('fs'), 7 | S = require('string'), 8 | string = require('string-formatter'), 9 | os = grunt.config('os'), 10 | config = grunt.config('config'), 11 | configuration = grunt.config('msbuild_configuration'), 12 | output_path_base = 'bin\\'+ configuration +'\\', 13 | nuget_builds = grunt.config('nuget_builds'), 14 | tasks = [], 15 | clean_format = os === 'win' ? '{0} start-process ' + 16 | '-NoNewWindow ' + 17 | //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow 18 | '-FilePath {1} ' + 19 | '-ArgumentList \' {2} /t:clean;Rebuild /p:Configuration={3} /p:OutputPath={4} \' ' : 20 | '{0} {1} /t:Rebuild /p:Configuration={2} ', 21 | //build_format = os === 'win' ? '{0} start-process ' + 22 | // '-NoNewWindow ' + 23 | // //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow 24 | // '-FilePath {1} ' + 25 | // '-ArgumentList \' {2} /p:Configuration={3} \' ' : 26 | // '{0} {1} /p:Configuration={2}', 27 | i; 28 | 29 | function addBuildWithTitle(title, dir, copyOnly) { 30 | var 31 | dir_path = string.format('{0}/../../Src/{1}/', __dirname, title), 32 | csproj = string.format('{0}{1}.csproj', dir_path, title), 33 | output_path = output_path_base + dir +'\\', 34 | clean = os === 'win' ? string.format(clean_format, config.win.powershell, config.win.msbuild, csproj, configuration, output_path) : 35 | string.format(clean_format, config.linux.msbuild, csproj, configuration), 36 | //build = os === 'win' ? string.format(build_format, config.win.powershell, config.win.msbuild, csproj, configuration ): 37 | // string.format(build_format, config.linux.msbuild, csproj, configuration), 38 | template_file_content = fs.readFileSync('./templates/AssemblyInfo.cs'); 39 | 40 | //template_file_content = S(template_file_content).replaceAll('@TITLE@', title).s; 41 | template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s; 42 | //grunt.log.writeln('template_file_content = "%s"', template_file_content); 43 | fs.writeFileSync(string.format('{0}Properties/AssemblyInfo.cs', dir_path), template_file_content); 44 | if (!copyOnly) { 45 | tasks.push(clean); 46 | //tasks.push(build); 47 | } 48 | } 49 | 50 | for (i = 0; i < nuget_builds.length; i++) { 51 | if (nuget_builds[i].Name !== 'SocketIoClientDotNet.netstandard1.3') { 52 | addBuildWithTitle(nuget_builds[i].Name, nuget_builds[i].NuGetDir, nuget_builds[i].copyOnly); 53 | } 54 | } 55 | 56 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 57 | grunt.config('shell.exec.command', tasks.join('&&')); 58 | grunt.task.run('shell'); 59 | 60 | if (configuration === 'Release') { 61 | grunt.task.run('clean:release'); 62 | if (os === 'win') { 63 | grunt.task.run('copy:release'); 64 | } else { 65 | grunt.task.run('copy:release_mono'); 66 | } 67 | } 68 | }); 69 | }; 70 | 71 | 72 | -------------------------------------------------------------------------------- /grunt/tasks/build-test.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('buildTest', 4 | 'test modules', function () { 5 | var 6 | fs = require('fs'), 7 | S = require('string'), 8 | string = require('string-formatter'), 9 | os = grunt.config('os'), 10 | config = grunt.config('config'), 11 | configuration = grunt.config('msbuild_configuration'), 12 | tasks = [], 13 | clean_format = os === 'win' ? '{0} start-process ' + 14 | '-NoNewWindow ' + 15 | //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow 16 | '-FilePath {1} ' + 17 | '-ArgumentList \' {2} /t:clean /p:Configuration={3} \' ' : 18 | '{0} {1} /t:clean /p:Configuration={2}', 19 | build_format = os === 'win' ? '{0} start-process ' + 20 | '-NoNewWindow ' + 21 | //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow 22 | '-FilePath {1} ' + 23 | '-ArgumentList \' {2} /p:Configuration={3} \' ' : 24 | '{0} {1} /p:Configuration={2}'; 25 | 26 | function addBuildWithTitle(title) { 27 | var 28 | dir_path = string.format('{0}/../../Src/{1}/', __dirname,title), 29 | csproj = string.format('{0}{1}.csproj', dir_path, title), 30 | clean = os === 'win' ? string.format(clean_format, config.win.powershell, config.win.msbuild, csproj, configuration ): 31 | string.format(clean_format, config.linux.msbuild, csproj, configuration), 32 | build = os === 'win' ? string.format(build_format, config.win.powershell, config.win.msbuild, csproj, configuration ): 33 | string.format(build_format, config.linux.msbuild, csproj, configuration), 34 | template_file_content = fs.readFileSync('./templates/AssemblyInfo.cs'); 35 | 36 | template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s; 37 | //grunt.log.writeln('template_file_content = "%s"', template_file_content); 38 | fs.writeFileSync(string.format('{0}Properties/AssemblyInfo.cs', dir_path), template_file_content); 39 | 40 | tasks.push(clean); 41 | tasks.push(build); 42 | } 43 | 44 | if (os === 'win') { 45 | addBuildWithTitle('SocketIoClientDotNet.Tests.net45'); 46 | } else { 47 | addBuildWithTitle('SocketIoClientDotNet.Tests.mono'); 48 | } 49 | 50 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 51 | grunt.config('shell.exec.command', tasks.join('&&')); 52 | grunt.task.run('shell'); 53 | }); 54 | }; 55 | 56 | 57 | -------------------------------------------------------------------------------- /grunt/tasks/createNugetPackage.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('createNugetPackage', 4 | 'create package ', function () { 5 | var 6 | fs = require('fs'), 7 | S = require('string'), 8 | string = require('string-formatter'), 9 | os = grunt.config('os'), 10 | config = grunt.config('config'), 11 | working_path = grunt.config('working_path'), 12 | package_path = working_path + '/NuGet/', 13 | package_lib_path = working_path + '/NuGet/lib/', 14 | //configuration = grunt.config('msbuild_configuration'), 15 | configuration = grunt.config('msbuild_configuration'), 16 | output_path_base = 'bin\\' + configuration + '\\', 17 | nuget_builds = grunt.config('nuget_builds'), 18 | nuget_path = os === 'win' ? 19 | config.win.nuget : config.linux.nuget, 20 | dst_path, 21 | template_file_content, 22 | i, 23 | tasks = []; 24 | 25 | //function createPackageWithTitle(title) { 26 | // var 27 | // dir_path = string.format('{0}/../../{1}/', __dirname, title), 28 | // csproj = string.format('{0}{1}.csproj', dir_path, title), 29 | // pack = string.format('{0} pack {1}', nuget_path, csproj); 30 | 31 | // tasks.push(pack); 32 | //} 33 | 34 | if (os !== 'win') { 35 | return; 36 | } 37 | if (configuration !== 'Release') { 38 | grunt.log.writeln('wrong configuration = ' + configuration); 39 | return; 40 | } 41 | 42 | //createPackageWithTitle('SocketIoClientDotNet'); 43 | 44 | 45 | if (! fs.existsSync(working_path)) { 46 | fs.mkdirSync(working_path); 47 | fs.mkdirSync(package_path); 48 | fs.mkdirSync(package_lib_path); 49 | } 50 | if (!fs.existsSync(package_path)) { 51 | fs.mkdirSync(package_path); 52 | fs.mkdirSync(package_lib_path); 53 | } 54 | if (!fs.existsSync(package_lib_path)) { 55 | fs.mkdirSync(package_lib_path); 56 | } 57 | 58 | for (i = 0; i < nuget_builds.length; i++) { 59 | dst_path = package_lib_path + nuget_builds[i].NuGetDir + '/'; 60 | //files = fs.readdirSync(dst_path); 61 | grunt.log.writeln(string.format('dst_path={0}', dst_path)); 62 | fs.mkdirSync(dst_path); 63 | } 64 | 65 | 66 | template_file_content = fs.readFileSync('./templates/SocketIoClientDotNet.nuspec'); 67 | template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s; 68 | fs.writeFileSync(string.format('{0}SocketIoClientDotNet.nuspec', package_path), template_file_content); 69 | 70 | 71 | 72 | function addBuildWithTitle(title, destsubdir, srcsubdir) { 73 | var 74 | src_path = string.format('{0}/../../Src/{1}/{2}{3}/', __dirname, title, output_path_base, srcsubdir), 75 | dst_path = package_lib_path + destsubdir + '/', 76 | //src_file = string.format('{0}SocketIoClientDotNet.dll', src_path), 77 | src_file = string.format('{0}SocketIoClientDotNet.dll', src_path), 78 | dst_file = string.format('{0}SocketIoClientDotNet.dll', dst_path); 79 | 80 | grunt.log.writeln(string.format('src_file={0} dst_file={1}', src_file, dst_file)); 81 | fs.writeFileSync(dst_file, fs.readFileSync(src_file)); 82 | 83 | //src_file = src_path + string.format('{0}.xml', title); 84 | //dst_file = string.format('{0}SocketIoClientDotNet.xml', dst_path); 85 | //grunt.log.writeln(string.format('src_file={0} dst_file={1}', src_file, dst_file)); 86 | //fs.writeFileSync(dst_file, fs.readFileSync(src_file)); 87 | } 88 | 89 | for (i = 0; i < nuget_builds.length; i++) { 90 | addBuildWithTitle(nuget_builds[i].Name, nuget_builds[i].NuGetDir, nuget_builds[i].SourceDir); 91 | } 92 | tasks.push('C:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe pwd'); 93 | tasks.push(string.format('{0} pack SocketIoClientDotNet.nuspec', config.win.nuget)); 94 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 95 | grunt.config('shell.exec.options.execOptions.cwd', package_path); 96 | grunt.config('shell.exec.command', tasks.join('&&')); 97 | grunt.task.run('shell'); 98 | }); 99 | }; -------------------------------------------------------------------------------- /grunt/tasks/createXamarinComponent.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('createXamarinComponent', 4 | 'create component ', function () { 5 | var 6 | fs = require('fs'), 7 | S = require('string'), 8 | string = require('string-formatter'), 9 | os = grunt.config('os'), 10 | config = grunt.config('config'), 11 | xamarin_component = os === 'win' ? config.win.xamarin_component : config.linux.xamarin_component, 12 | working_path = grunt.config('working_path'), 13 | package_path = working_path + '/Component/', 14 | configuration = grunt.config('msbuild_configuration'), 15 | template_file_content, 16 | tasks = []; 17 | 18 | if (configuration !== 'Release') { 19 | grunt.log.writeln('wrong configuration = ' + configuration); 20 | return; 21 | } 22 | 23 | 24 | if (! fs.existsSync(working_path)) { 25 | fs.mkdirSync(working_path); 26 | fs.mkdirSync(package_path); 27 | } 28 | if (!fs.existsSync(package_path)) { 29 | fs.mkdirSync(package_path); 30 | } 31 | 32 | 33 | template_file_content = fs.readFileSync('./templates/SocketIoClientDotNet.yaml'); 34 | template_file_content = S(template_file_content).replaceAll('@VERSION@', config.version).s; 35 | fs.writeFileSync(string.format('{0}component.yaml', package_path), template_file_content); 36 | 37 | 38 | tasks.push('echo %cd%'); 39 | tasks.push(string.format('{0} package', xamarin_component)); 40 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 41 | grunt.config('shell.exec.options.execOptions.cwd', package_path); 42 | grunt.config('shell.exec.command', tasks.join('&&')); 43 | grunt.task.run('shell'); 44 | }); 45 | }; -------------------------------------------------------------------------------- /grunt/tasks/install-npm.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('installNpm', 4 | 'install node modules', function () { 5 | var 6 | string = require('string-formatter'), 7 | server_path2 = grunt.config('server_path'), 8 | os = grunt.config('os'), 9 | config = grunt.config('config'), 10 | win_pwd_command = string.format('{0} pwd', config.win.powershell); 11 | 12 | grunt.log.writeln('server_path = "%s"', server_path2); 13 | grunt.log.writeln('win_pwd_command = "%s"', win_pwd_command); 14 | 15 | if (os === 'win') { 16 | grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>'); 17 | 18 | grunt.config('shell.exec.command', [win_pwd_command, 19 | 'npm install'].join('&&')); 20 | grunt.task.run('shell'); 21 | 22 | } else { 23 | 24 | grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>'); 25 | grunt.config('shell.exec.command', ['pwd', 'npm install'].join('&&')); 26 | grunt.task.run('shell'); 27 | } 28 | 29 | }); 30 | }; 31 | 32 | 33 | -------------------------------------------------------------------------------- /grunt/tasks/nuget.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('nuget', 4 | 'get nuget assemblies', function () { 5 | var 6 | //fs = require('fs'), 7 | //S = require('string'), 8 | string = require('string-formatter'), 9 | os = grunt.config('os'), 10 | config = grunt.config('config'), 11 | //configuration = grunt.config('msbuild_configuration'), 12 | nuget_builds = grunt.config('nuget_builds'), 13 | nuget_path = os === 'win' ? 14 | config.win.nuget : config.linux.nuget, 15 | format_str = os === 'win' ? 16 | '{0} restore "{1}"' : 17 | 'mono --runtime=v4.0.30319 {0} restore {1}', 18 | tasks = [], 19 | i; 20 | 21 | function restorePackagesWithTitle(title) { 22 | var 23 | sln = string.format('{0}/../../Src/{1}/{2}.sln',__dirname, title,title), 24 | restore = string.format(format_str, nuget_path, sln); 25 | 26 | tasks.push(restore); 27 | } 28 | 29 | if (os === 'win') { 30 | for (i = 0; i < nuget_builds.length; i++) { 31 | restorePackagesWithTitle(nuget_builds[i].Name); 32 | } 33 | } 34 | 35 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 36 | grunt.config('shell.exec.command', tasks.join('&&')); 37 | grunt.task.run('shell'); 38 | }); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /grunt/tasks/start-server.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('startServer', 4 | 'start server', function () { 5 | var 6 | server_path = grunt.config('server_path'), 7 | os = grunt.config('os'), 8 | string = require('string-formatter'), 9 | config = grunt.config('config'), 10 | tasks = [], 11 | start, 12 | pwd; 13 | 14 | grunt.log.writeln('server_path = "%s"', server_path); 15 | 16 | if (os === 'win') { 17 | 18 | start = '{0} start-process ' + 19 | '-NoNewWindow ' + 20 | //'-WindowStyle Normal ' + //-WindowStyle (Hidden | Normal) | -NoNewWindow 21 | '-FilePath node ' + 22 | '-ArgumentList \' server.js \' '; 23 | start = string.format(start, config.win.powershell); 24 | pwd = string.format('{0} pwd',config.win.powershell); 25 | 26 | tasks.push(pwd); 27 | tasks.push(start); 28 | 29 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 30 | grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>'); 31 | grunt.config('shell.exec.command', tasks.join('&&')); 32 | grunt.task.run('shell'); 33 | 34 | } else { 35 | 36 | grunt.config('shell.exec.options.execOptions.cwd', '<%= server_path %>'); 37 | grunt.config('shell.exec.command', ['pwd', 'node server.js'].join('&&')); 38 | grunt.task.run('shell'); 39 | } 40 | 41 | }); 42 | }; 43 | 44 | 45 | -------------------------------------------------------------------------------- /grunt/tasks/test-client.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('testClient', 4 | 'test cs', function () { 5 | var 6 | string = require('string-formatter'), 7 | os = grunt.config('os'), 8 | config = grunt.config('config'), 9 | tasks = [], 10 | configuration = grunt.config('msbuild_configuration'), 11 | test_format_str = os === 'win' ? 12 | '{0}/xunit.console.exe {1} -nunit test.xml -parallel none' : 13 | 'mono {0}/xunit.console.clr4.exe {1}', 14 | 15 | xunit_path = os === 'win' ? 16 | config.win.xunit_path : config.linux.xunit_path; 17 | 18 | function addTestDllWithTitle(title) { 19 | var 20 | dir_path = string.format('{0}/../../Src/{1}/', __dirname, title), 21 | test_dll = string.format('{0}bin/{1}/{2}.dll', dir_path, configuration, title); 22 | 23 | tasks.push( string.format(test_format_str,xunit_path, test_dll) ); 24 | } 25 | 26 | if (os === 'win') { 27 | addTestDllWithTitle('SocketIoClientDotNet.Tests.net45'); 28 | } else { 29 | addTestDllWithTitle('SocketIoClientDotNet.Tests.mono'); 30 | } 31 | 32 | grunt.log.writeln('tasks = %s', JSON.stringify(tasks)); 33 | grunt.config('shell.exec.command', tasks.join('&&')); 34 | grunt.task.run('shell'); 35 | 36 | }); 37 | }; 38 | 39 | 40 | -------------------------------------------------------------------------------- /grunt/templates/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SocketIoClientDotNet")] 8 | [assembly: AssemblyDescription("Socket.IO Client Library for .Net")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Quobject Software")] 11 | [assembly: AssemblyProduct("SocketIoClientDotNet")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a95e75cd-35e6-4e88-9e22-631e3fd01546")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("@VERSION@")] 35 | [assembly: AssemblyFileVersion("@VERSION@")] 36 | -------------------------------------------------------------------------------- /grunt/templates/SocketIoClientDotNet - xamarin.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SocketIoClientDotNet 5 | @VERSION@-beta1 6 | SocketIoClientDotNet 7 | Matthias Ludwig 8 | http://opensource.org/licenses/MIT 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | https://github.com/Quobject/SocketIoClientDotNet/ 63 | This is the Socket.IO Client Library for .NET. 64 | This library supports all of the features the JS client does, including events, options and upgrading transport. SocketIoClientDotNet has a similar api to those of the JavaScript client. 65 | socket.io.client 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /grunt/templates/SocketIoClientDotNet.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SocketIoClientDotNet 5 | @VERSION@-beta1 6 | SocketIoClientDotNet 7 | Matthias Ludwig 8 | http://opensource.org/licenses/MIT 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | https://github.com/Quobject/SocketIoClientDotNet/ 39 | This is the Socket.IO Client Library for .NET. 40 | This library supports all of the features the JS client does, including events, options and upgrading transport. SocketIoClientDotNet has a similar api to those of the JavaScript client. 41 | socket.io.client 42 | 43 | 44 | -------------------------------------------------------------------------------- /grunt/templates/SocketIoClientDotNet.yaml: -------------------------------------------------------------------------------- 1 | %YAML 1.2 2 | --- 3 | #info 4 | name: Socket.IO Client .NET 5 | id: SocketIoClientDotNet 6 | publisher: Matthias Ludwig 7 | publisher-url: https://github.com/Quobject/SocketIoClientDotNet/ 8 | summary: This is the Socket.IO Client Library for .NET. 9 | version: @VERSION@ 10 | src-url: https://github.com/Quobject/SocketIoClientDotNet 11 | 12 | # docs 13 | details: ../../DETAILS.md 14 | license: ../../LICENSE.md 15 | getting-started: ../../DETAILS.md 16 | icons: 17 | - ../../pics/socketio_128x128.png 18 | - ../../pics/socketio_512x512.png 19 | 20 | # assemblies 21 | is_shell: true 22 | no_build: true 23 | # NuGets used by new versions of XS and VS 24 | packages: 25 | android: 26 | - SocketIoClientDotNet, Version=@VERSION@ 27 | local-nuget-repo: ../NuGet/ 28 | # libraries used for old versions of XS 29 | libraries: 30 | android: ../NuGet/lib/monoandroid10/SocketIoClientDotNet.dll 31 | ios: ../NuGet/lib/xamarinios10/SocketIoClientDotNet.dll 32 | ios-unified: ../NuGet/lib/monotouch10/SocketIoClientDotNet.dll 33 | winphone-8.0: ../NuGet/lib/windowsphone8/SocketIoClientDotNet.dll 34 | winphone-8.1: ../NuGet/lib/portable-wpa81+wp81/SocketIoClientDotNet.dll 35 | win8: ../NuGet/lib/netcore45/SocketIoClientDotNet.dll 36 | 37 | # samples 38 | samples: 39 | - name: Android Sample 40 | path: ../../Src/SocketIoClientDotNet.Sample.Xamarin-Android/SocketIoClientDotNet.Sample.Xamarin-Android.sln 41 | removeProjects: 42 | - SocketIoClientDotNet.Xamarin-Android 43 | installNuGets: 44 | - project: SocketIoClientDotNet.Sample.Xamarin-Android 45 | packages: 46 | - SocketIoClientDotNet 47 | - name: iOS Sample 48 | path: ../../Src/SocketIoClientDotNet.Sample.Xamarin-iOS/SocketIoClientDotNet.Sample.Xamarin-iOS.sln 49 | removeProjects: 50 | - SocketIoClientDotNet.Xamarin-iOS 51 | installNuGets: 52 | - project: SocketIoClientDotNet.Sample.Xamarin-iOS 53 | packages: 54 | - SocketIoClientDotNet 55 | -------------------------------------------------------------------------------- /pics/donate-bitcoins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/donate-bitcoins.png -------------------------------------------------------------------------------- /pics/donate-paypal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/donate-paypal.gif -------------------------------------------------------------------------------- /pics/issues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/issues.png -------------------------------------------------------------------------------- /pics/socketio.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 29 | 34 | 40 | 45 | 50 | 56 | 57 | 58 | 79 | 81 | 82 | 84 | image/svg+xml 85 | 87 | 88 | 89 | 90 | 91 | 96 | 103 | 139 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /pics/socketio_1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/socketio_1024x1024.png -------------------------------------------------------------------------------- /pics/socketio_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/socketio_128x128.png -------------------------------------------------------------------------------- /pics/socketio_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/socketio_256x256.png -------------------------------------------------------------------------------- /pics/socketio_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Quobject/SocketIoClientDotNet/7217ee17a87b3cc9d826a16358d513718dd35a92/pics/socketio_512x512.png --------------------------------------------------------------------------------