Browse Source

Modified RequestHandshake.cs, ResponseHandshake.cs

pull/21/merge
sta 12 years ago
parent
commit
9190984c7c
  1. BIN
      Example/bin/Debug_Ubuntu/example.exe
  2. BIN
      Example/bin/Debug_Ubuntu/example.exe.mdb
  3. BIN
      Example/bin/Debug_Ubuntu/websocket-sharp.dll
  4. BIN
      Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb
  5. BIN
      Example1/bin/Debug_Ubuntu/example1.exe
  6. BIN
      Example1/bin/Debug_Ubuntu/example1.exe.mdb
  7. BIN
      Example1/bin/Debug_Ubuntu/websocket-sharp.dll
  8. BIN
      Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb
  9. BIN
      Example2/bin/Debug_Ubuntu/example2.exe
  10. BIN
      Example2/bin/Debug_Ubuntu/example2.exe.mdb
  11. BIN
      Example2/bin/Debug_Ubuntu/websocket-sharp.dll
  12. BIN
      Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb
  13. BIN
      Example3/bin/Debug_Ubuntu/Example3.exe
  14. BIN
      Example3/bin/Debug_Ubuntu/Example3.exe.mdb
  15. BIN
      Example3/bin/Debug_Ubuntu/websocket-sharp.dll
  16. BIN
      Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb
  17. 6
      websocket-sharp.userprefs
  18. 36
      websocket-sharp/RequestHandshake.cs
  19. 11
      websocket-sharp/ResponseHandshake.cs
  20. BIN
      websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll
  21. BIN
      websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb
  22. BIN
      websocket-sharp/websocket-sharp.pidb

BIN
Example/bin/Debug_Ubuntu/example.exe

BIN
Example/bin/Debug_Ubuntu/example.exe.mdb

BIN
Example/bin/Debug_Ubuntu/websocket-sharp.dll

BIN
Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb

BIN
Example1/bin/Debug_Ubuntu/example1.exe

BIN
Example1/bin/Debug_Ubuntu/example1.exe.mdb

BIN
Example1/bin/Debug_Ubuntu/websocket-sharp.dll

BIN
Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb

BIN
Example2/bin/Debug_Ubuntu/example2.exe

BIN
Example2/bin/Debug_Ubuntu/example2.exe.mdb

BIN
Example2/bin/Debug_Ubuntu/websocket-sharp.dll

BIN
Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb

BIN
Example3/bin/Debug_Ubuntu/Example3.exe

BIN
Example3/bin/Debug_Ubuntu/Example3.exe.mdb

BIN
Example3/bin/Debug_Ubuntu/websocket-sharp.dll

BIN
Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb

6
websocket-sharp.userprefs

@ -1,10 +1,6 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug_Ubuntu" />
<MonoDevelop.Ide.Workbench ActiveDocument="websocket-sharp/WebSocket.cs">
<Files>
<File FileName="websocket-sharp/WebSocket.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workbench />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>

36
websocket-sharp/RequestHandshake.cs

@ -1,4 +1,4 @@
#region MIT License
#region License
/*
* RequestHandshake.cs
*
@ -37,13 +37,13 @@ namespace WebSocketSharp {
internal class RequestHandshake : Handshake
{
#region Private Field
#region Private Fields
private NameValueCollection _queryString;
#endregion
#region Private Constructor
#region Private Constructors
private RequestHandshake()
{
@ -51,20 +51,20 @@ namespace WebSocketSharp {
#endregion
#region Public Constructor
#region Public Constructors
public RequestHandshake(string uriString)
{
HttpMethod = "GET";
RequestUri = uriString.ToUri();
AddHeader("User-Agent", "websocket-sharp/1.0");
AddHeader("Upgrade", "websocket");
AddHeader("Connection", "Upgrade");
}
#endregion
#region Properties
#region Public Properties
public CookieCollection Cookies {
get {
@ -132,17 +132,7 @@ namespace WebSocketSharp {
#endregion
#region Public Static Methods
public static RequestHandshake Parse(WebSocketContext context)
{
return new RequestHandshake {
Headers = context.Headers,
HttpMethod = "GET",
RequestUri = context.RequestUri,
ProtocolVersion = HttpVersion.Version11
};
}
#region Public Methods
public static RequestHandshake Parse(string[] request)
{
@ -165,9 +155,15 @@ namespace WebSocketSharp {
};
}
#endregion
#region Public Method
public static RequestHandshake Parse(WebSocketContext context)
{
return new RequestHandshake {
Headers = context.Headers,
HttpMethod = "GET",
RequestUri = context.RequestUri,
ProtocolVersion = HttpVersion.Version11
};
}
public void SetCookies(CookieCollection cookies)
{

11
websocket-sharp/ResponseHandshake.cs

@ -1,4 +1,4 @@
#region MIT License
#region License
/*
* ResponseHandshake.cs
*
@ -35,7 +35,7 @@ namespace WebSocketSharp {
internal class ResponseHandshake : Handshake
{
#region Constructor
#region Public Constructors
public ResponseHandshake()
: this(HttpStatusCode.SwitchingProtocols)
@ -47,12 +47,13 @@ namespace WebSocketSharp {
public ResponseHandshake(HttpStatusCode code)
{
StatusCode = ((int)code).ToString();
Reason = code.GetDescription();
Reason = code.GetDescription();
AddHeader("Server", "websocket-sharp/1.0");
}
#endregion
#region Properties
#region Public Properties
public CookieCollection Cookies {
get {
@ -80,7 +81,7 @@ namespace WebSocketSharp {
#endregion
#region Methods
#region Public Methods
public static ResponseHandshake CreateCloseResponse(HttpStatusCode code)
{

BIN
websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll

BIN
websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb

BIN
websocket-sharp/websocket-sharp.pidb

Loading…
Cancel
Save