hramenko / bauglir-websocket

Automatically exported from code.google.com/p/bauglir-websocket
0 stars 0 forks source link

.NET TypeLoadException on GetConnectionInstance #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I used BauglirWebSocket2_.net_demo.2.0.1, _.net_library.2.0.4 and 
_html.2.0.3. I replaced the WebSocketLib-folder from the demo with the one from 
library 2.0.4 and started the Demo-Server with the default settings.
2. Click on "Open" in ws.html.

What is the expected output? What do you see instead?
VS2010 breaks on line 1722 of WebSocketServer.cs:
System.TypeLoadException wurde nicht behandelt.
  Message=Eine abgeleitete Methode "SendData" im Typ "ServerDemo.TestWebSocketServerConnection" der Assembly "ServerDemo, Version=1.0.4470.15471, Culture=neutral, PublicKeyToken=null" kann den Zugriff nicht reduzieren.
  Source=ServerDemo
  TypeName=ServerDemo.TestWebSocketServerConnection
  StackTrace:
       bei ServerDemo.TestWebSocketServer.GetConnectionInstance(TcpClient aClient, WebSocketHeaders aHeaders, String aHost, String aPort, String aResourceName, String aOrigin, String aCookie, String aVersion, String& aProtocol, String& aExtension, Int32& aHttpCode)
       bei Bauglir.Ex.WebSocketServer.AddConnection(TcpClient aClient, Stream aStream) in E:\work\csharp\Projects\_Free\WebSocket2\WebSocketLib\WebSocketServer.cs:Zeile 1722.
       bei Bauglir.Ex.WebSocketServer.Execute() in E:\work\csharp\Projects\_Free\WebSocket2\WebSocketLib\WebSocketServer.cs:Zeile 1907.
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()

The error-message in English would be:
A derived method "SendData" in Type ... of the assembly ... cannot reduce 
access.

What version of the product are you using? On what operating system?
Windows 7 HomePremium 64bit SP1 German
Google Chrome 18 (latest beta)
Firefox 11.0

Original issue reported on code.google.com by s.neum...@dacius.com on 28 Mar 2012 at 8:53

GoogleCodeExporter commented 9 years ago
Hello

There is TestWebSocketServerConnection class defined in ServerDemo, derived 
from WebSocketServerConnection, but the access level of few functions have been 
changed from protected to public (mainly SendData), 

protected override bool SendData(bool aWriteFinal, bool aRes1, bool aRes2, bool 
aRes3, int aWriteCode, MemoryStream aStream)

public override bool SendData(bool aWriteFinal, bool aRes1, bool aRes2, bool 
aRes3, int aWriteCode, MemoryStream aStream)

so update function signatures in TestWebSocketServerConnection  class

Original comment by Bronisla...@bauglir.com on 28 Mar 2012 at 9:55