Skip to content

Commit 50db200

Browse files
committed
0.9.10 release
1 parent 236134c commit 50db200

File tree

12 files changed

+168
-48
lines changed

12 files changed

+168
-48
lines changed

Src/EngineIOClientDotNet.Tests.netcore45.UnitTestLibrary/ClientTests/BinaryWebSocketTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public void ReceiveBinaryData()
7171
}
7272

7373
object result = events.Dequeue();
74+
if (result is string)
75+
{
76+
log.Info(result as string);
77+
}
7478
CollectionAssert.AreEqual(binaryData, (byte[]) result);
7579

7680
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
7+
using Quobject.EngineIoClientDotNet.Client;
8+
using Quobject.EngineIoClientDotNet.Modules;
9+
using Quobject.EngineIoClientDotNet_Tests.ClientTests;
10+
11+
namespace EngineIoClientDotNet.Tests.portable_wpa81_wp81.TestApp.ClientTests
12+
{
13+
[TestClass]
14+
public class IssuesTest : Connection
15+
{
16+
17+
/// <summary>
18+
/// https://github.com/Quobject/EngineIoClientDotNet/issues/2
19+
/// After connecting to the websocket with Engine.IO, I recieve messages from the webserver, but as
20+
/// soon as the second ping is sent, the socket closes.
21+
/// Edit: This is a Windows Phone 8.1 project (Universal app, C#)
22+
/// </summary>
23+
[TestMethod]
24+
public void WebsocketClosesAfterWritingPingPacket()
25+
{
26+
27+
var log = LogManager.GetLogger(Global.CallerName());
28+
log.Info("Start");
29+
bool open = false;
30+
bool close = false;
31+
32+
33+
var options = CreateOptions();
34+
//options.ForceBase64 = true;
35+
//options.Secure = false;
36+
//options.RememberUpgrade = false;
37+
//options.TimestampRequests = true;
38+
var socket = new Socket(options);
39+
40+
//You can use `Socket` to connect:
41+
//var socket = new Socket("ws://localhost");
42+
43+
socket.On(Socket.EVENT_OPEN, () =>
44+
{
45+
log.Info("EVENT_OPEN");
46+
open = true;
47+
});
48+
49+
socket.On(Socket.EVENT_CLOSE, () =>
50+
{
51+
log.Info("EVENT_CLOSE");
52+
close = true;
53+
});
54+
socket.Open();
55+
56+
57+
58+
59+
Task.Delay(60000).Wait();
60+
Assert.IsTrue(open);
61+
Assert.IsFalse(close);
62+
63+
socket.Close();
64+
}
65+
}
66+
}

Src/EngineIoClientDotNet.Tests.portable-wpa81+wp81.TestApp/EngineIoClientDotNet.Tests.portable-wpa81+wp81.TestApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<Compile Include="..\EngineIOClientDotNet.Tests.netcore45.UnitTestLibrary\ParserTests\TestsParser.cs">
113113
<Link>ParserTests\TestsParser.cs</Link>
114114
</Compile>
115+
<Compile Include="ClientTests\IssuesTest.cs" />
115116
<Compile Include="Properties\AssemblyInfo.cs" />
116117
</ItemGroup>
117118
<ItemGroup>

Src/EngineIoClientDotNet.mono/Client/Socket.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,19 @@ private void SetPing()
538538

539539
private void Ping()
540540
{
541+
//Send("primus::ping::" + GetJavaTime());
541542
SendPacket(Packet.PING);
542543
}
543544

545+
//private static string GetJavaTime()
546+
//{
547+
// var st = new DateTime(1970, 1, 1);
548+
// var t = (DateTime.Now.ToUniversalTime() - st);
549+
// var returnstring = t.TotalMilliseconds.ToString();
550+
// returnstring = returnstring.Replace(".", "-");
551+
// return returnstring;
552+
//}
553+
544554
public void Write(string msg, Action fn = null)
545555
{
546556
Send(msg, fn);

Src/EngineIoClientDotNet.mono/Client/Transports/WebSocket_netcore45.cs

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,7 @@ protected override void DoOpen()
6767
}
6868
}
6969

70-
//private byte[] readBuffer;
71-
//private async void ReceiveData(object state)
72-
//{
73-
// var log = LogManager.GetLogger(Global.CallerName());
74-
75-
// int bytesReceived = 0;
76-
// try
77-
// {
78-
// Stream readStream = (Stream)state;
79-
80-
// while (true) // Until closed and ReadAsync fails.
81-
// {
82-
// int read = await readStream.ReadAsync(readBuffer, 0, readBuffer.Length);
83-
// bytesReceived += read;
84-
// log.Info("ws_MessageReceived e.Message= " + data);
85-
// this.OnData(readBuffer);
86-
// // Do something with the data.
87-
// }
88-
// }
89-
// catch (ObjectDisposedException e)
90-
// {
91-
// // Display a message that the read has stopped, or take a specific action
92-
// this.OnError("ObjectDisposedException", e);
93-
// }
94-
// catch (Exception ex)
95-
// {
96-
// WebErrorStatus status = WebSocketError.GetStatus(ex.GetBaseException().HResult);
97-
// // Add your specific error-handling code here.
98-
// this.OnError("ReceiveData", ex);
99-
// }
100-
//}
70+
10171

10272

10373
void ws_MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
@@ -262,8 +232,12 @@ protected override void DoClose()
262232
{
263233
ws.Closed -= ws_Closed;
264234
//ws.MessageReceived -= ws_MessageReceived;
265-
dataWriter.Dispose();
266-
dataWriter = null;
235+
236+
if (dataWriter != null)
237+
{
238+
dataWriter.Dispose();
239+
dataWriter = null;
240+
}
267241

268242
ws.Close(1000, "DoClose");
269243
ws.Dispose();

Src/EngineIoClientDotNet.net35/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.9.9")]
35-
[assembly: AssemblyFileVersion("0.9.9")]
34+
[assembly: AssemblyVersion("0.9.10")]
35+
[assembly: AssemblyFileVersion("0.9.10")]

Src/EngineIoClientDotNet.net45/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.9.9")]
35-
[assembly: AssemblyFileVersion("0.9.9")]
34+
[assembly: AssemblyVersion("0.9.10")]
35+
[assembly: AssemblyFileVersion("0.9.10")]

Src/EngineIoClientDotNet.netcore45/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.9.9")]
35-
[assembly: AssemblyFileVersion("0.9.9")]
34+
[assembly: AssemblyVersion("0.9.10")]
35+
[assembly: AssemblyFileVersion("0.9.10")]

Src/EngineIoClientDotNet.portable-wpa81+wp81/EngineIoClientDotNet.portable-wpa81+wp81.sln

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,48 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EngineIoClientDotNet.portab
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EngineIoClientDotNet.Tests.portable-wpa81+wp81.TestApp", "..\EngineIoClientDotNet.Tests.portable-wpa81+wp81.TestApp\EngineIoClientDotNet.Tests.portable-wpa81+wp81.TestApp.csproj", "{7A453124-AD88-4167-80C0-19C09C4D809D}"
99
EndProject
10+
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "TestServer(1)", "http://localhost:48775", "{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}"
11+
ProjectSection(WebsiteProperties) = preProject
12+
UseIISExpress = "true"
13+
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
14+
Debug.AspNetCompiler.VirtualPath = "/localhost_48775"
15+
Debug.AspNetCompiler.PhysicalPath = "..\..\TestServer\"
16+
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_48775\"
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_48775"
22+
Release.AspNetCompiler.PhysicalPath = "..\..\TestServer\"
23+
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_48775\"
24+
Release.AspNetCompiler.Updateable = "true"
25+
Release.AspNetCompiler.ForceOverwrite = "true"
26+
Release.AspNetCompiler.FixedNames = "false"
27+
Release.AspNetCompiler.Debug = "False"
28+
SlnRelativePath = "..\..\TestServer\"
29+
EndProjectSection
30+
EndProject
31+
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "grunt(1)", "http://localhost:8528", "{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}"
32+
ProjectSection(WebsiteProperties) = preProject
33+
UseIISExpress = "true"
34+
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
35+
Debug.AspNetCompiler.VirtualPath = "/localhost_8528"
36+
Debug.AspNetCompiler.PhysicalPath = "..\..\grunt\"
37+
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_8528\"
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_8528"
43+
Release.AspNetCompiler.PhysicalPath = "..\..\grunt\"
44+
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_8528\"
45+
Release.AspNetCompiler.Updateable = "true"
46+
Release.AspNetCompiler.ForceOverwrite = "true"
47+
Release.AspNetCompiler.FixedNames = "false"
48+
Release.AspNetCompiler.Debug = "False"
49+
SlnRelativePath = "..\..\grunt\"
50+
EndProjectSection
51+
EndProject
1052
Global
1153
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1254
Debug|Any CPU = Debug|Any CPU
@@ -55,6 +97,30 @@ Global
5597
{7A453124-AD88-4167-80C0-19C09C4D809D}.Release|x86.ActiveCfg = Release|x86
5698
{7A453124-AD88-4167-80C0-19C09C4D809D}.Release|x86.Build.0 = Release|x86
5799
{7A453124-AD88-4167-80C0-19C09C4D809D}.Release|x86.Deploy.0 = Release|x86
100+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
101+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
102+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|ARM.ActiveCfg = Debug|Any CPU
103+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
104+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
105+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Debug|x86.ActiveCfg = Debug|Any CPU
106+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
107+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|Any CPU.Build.0 = Debug|Any CPU
108+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|ARM.ActiveCfg = Debug|Any CPU
109+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
110+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
111+
{27F2C60C-D314-4124-BDDF-E8A6A4780D1F}.Release|x86.ActiveCfg = Debug|Any CPU
112+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
113+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
114+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|ARM.ActiveCfg = Debug|Any CPU
115+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
116+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
117+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Debug|x86.ActiveCfg = Debug|Any CPU
118+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|Any CPU.ActiveCfg = Debug|Any CPU
119+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|Any CPU.Build.0 = Debug|Any CPU
120+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|ARM.ActiveCfg = Debug|Any CPU
121+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
122+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
123+
{6F45D264-CDF3-4E10-9EA4-E234B675CAE4}.Release|x86.ActiveCfg = Debug|Any CPU
58124
EndGlobalSection
59125
GlobalSection(SolutionProperties) = preSolution
60126
HideSolutionNode = FALSE

Src/EngineIoClientDotNet.portable-wpa81+wp81/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.9.9")]
35-
[assembly: AssemblyFileVersion("0.9.9")]
34+
[assembly: AssemblyVersion("0.9.10")]
35+
[assembly: AssemblyFileVersion("0.9.10")]

0 commit comments

Comments
 (0)