WebSocket4Net


WebSocket4Net


WebSocket4Net is a .NET websocket client
implementation.


It originated from SuperWebSocket
WebSocket Client. For better developing of the websocket client, it was
separated from SuperWebSocket and was renamed to
WebSocket4Net.

WebSocket4Net will provide websocket client implementation
for many different kinds of runtime:



  • .Net 3.5
  • .Net 4.0
  • Mono
  • Silverlight
  • WindowsPhone
  • Mono for Android
  • MonoTouch


  MonoWindows Phone



It is compatible with many websocket drafts:



  • Hybi-00
  • Hybi-10
  • RFC6455


NuGet Package: http://www.nuget.org/packages/WebSocket4Net



Demo code:



using WebSocket4Net;
 
WebSocket websocket = new WebSocket("ws://localhost:2012/");
websocket.Opened += new EventHandler(websocket_Opened);
websocket.Error += new EventHandler<ErrorEventArgs>(websocket_Error);
websocket.Closed += new EventHandler(websocket_Closed);
websocket.MessageReceived += new EventHandler(websocket_MessageReceived);
websocket.Open();

private void websocket_Opened(object sender, EventArgs e)
{
     websocket.Send("Hello World!");
}



Recommended .NET WebSocket Server


SuperWebSocket -  http://superwebsocket.codeplex.com/



Consult/feature request:


kerry-jiang@hotmail.com


 

 

 

https://github.com/statianzo/Fleck

 

  1. C#95.6%
  2. Ruby4.3%
  3. Shell0.1%

C# Websocket Implementation      Read more

Sorry, but there was a problem saving your changes.

Add a description to this repository
Add a website to this repository
Save Changes

Cancel

Read-Only access

DismissOctotip: You've activated the file finder        by pressing t Start typing to filter the        file list. Use and        to navigate,        enter to view files.     

name
No matching files

Jump to Line

Go

Latest commit to the master branch

readme.markdown

Fleck project-status

Fleck is a WebSocket server implementation in C#. Branched from theNugget project, Fleck requires no inheritance, container, or additional references.

Example

The following is an example that will echo to a client.

var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
  {
    socket.OnOpen = () => Console.WriteLine("Open!");
    socket.OnClose = () => Console.WriteLine("Close!");
    socket.OnMessage = message => socket.Send(message);
  });

Supported WebSocket Versions

Fleck supports several WebSocket versions of modern web browsers

  • Hixie-Draft-76/Hybi-00 (Safari 5, Chrome < 14, Firefox 4 (when enabled))
  • Hybi-07 (Firefox 6)
  • Hybi-10 (Chrome 14-16, Firefox 7)
  • Hybi-13 (Chrome 17+)

Secure WebSockets (wss://)

Enabling secure connections requires two things: using the scheme wss instead of ws, and pointing Fleck to an x509 certificate containing a public and private key

var server = new WebSocketServer("wss://localhost:8431");
server.Certificate = "MyCert.cer";
server.Start(socket =>
  {
    //...use as normal
  });

License

The MIT License

Copyright (c) 2010-2012 Jason Staten

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

 

 

------------------------------------------------------------------------------------------

 

 

http://supersocket.codeplex.com/

 


SuperSocket is a light weight, cross platform and extensible
socket application framework. You can use it to build a server side socket
application (like FTP server, SMTP/POP3/IMAP4 server, SIP server, SNMP server,
etc) easily without thinking about how to use socket, how to maintain the socket
connections and how socket works(synchronize/asynchronize).

It is a pure
C# project which is designed to be extended, so it is easy to be integrated to
your existing system. If your systems (like forum/CRM/MIS/HRM/ERP) are developed
in .NET language, you must be able to use SuperSocket to build
your socket application as a part of your current system perfectly.

I
know there are two famous NIO open source frameworks named
"MINA" and "Netty" in Java World which are
used widely by developers. If you want to look for a .NET portion of MINA or
Netty, I suggest you try SuperSocket, although
SuperSocket is not strong like MINA and Netty but it is very
simple and you can use it easily.

The source code of
SuperSocket also include some service implementation samples
which you can follow.


Latest stable release:


SuperSocket 1.4 SP3    http://supersocket.codeplex.com/releases/view/82616


Latest beta release:


SuperSocket 1.5 beta 1    http://supersocket.codeplex.com/releases/view/82807


Features:



  • Very easy to use. You can create a robust socket server only by several
    classes
  • Support Sync and Async communication
    modes. You can change your socket server running mode by only changing
    configuration wihtout any code changes
  • Support custom protocol, no matter your protocol is a command line protocol
    or a binary one. Another open source project SuperWebSocket is built
    upon SuperSocket and take advantage of this custom protocol
    feature of it.
  • Support SSL/TLS encryption automatically
  • Support multiple socket server instances. You can define many socket servers
    on different ports in configuration, SuperSocket can run those
    servers in the same application/service
  • SuperSocket can run as console application and windows
    service. It provide a bat file to install SuperSocket as a
    windows service.
  • Flexible logging strategy which can log most of socket activities
  • Also support UDP socket
  • Support IPv6
  • Support Windows Azure
  • Support running in Unix system (by Mono 2.10 or above
    version)
  • Built-in socket policy server for Flash and Silverlight clients which you
    can use directly


MONO           windows azure



Documentation:




Consult/feature request/paid project customization:


kerry-jiang@hotmail.com


Skype: kerry-jiang


Google+: https://plus.google.com/103256006501871418573/


Author's LinkedIn profile: http://cn.linkedin.com/in/kerryjiang


LinkedIn Group: http://www.linkedin.com/groups/SuperSocket-User-Group-3821247


QQ Group: 135969383

 

 

SQL Server 中,`EXISTS` 是一个用于检查是否存在符合特定条件的记录的逻辑运算符。`EXISTS` 返回一个布尔值,即 `TRUE` 或 `FALSE`,表示查询结果集是否包含匹配条件的记录。下面是 `EXISTS` 的详细用法: 1. 基本语法: ```sql SELECT column_name(s) FROM table_name WHERE EXISTS (SELECT column_name FROM table_name WHERE condition); ``` 2. 示例: 假设有两个表,分别为 `customers` 和 `orders`, `customers` 表中包含了所有客户的信息,而 `orders` 表中包含了所有的订单信息。我们需要查询所有已经下过订单的客户的姓名和地址,可以使用以下 SQL 语句: ```sql SELECT customerName, address FROM customers WHERE EXISTS (SELECT * FROM orders WHERE orders.customerID = customers.customerID); ``` 在上面的 SQL 语句中,`EXISTS` 子查询中的条件是查找 `orders` 表中的所有记录,其中 `orders.customerID = customers.customerID` 表示连接两个表的条件,即匹配两个表中的 `customerID` 列。如果 `EXISTS` 子查询返回 `TRUE`,则 `customerName` 和 `address` 列的值会被返回。 3. 注意事项: - `EXISTS` 子查询必须包含一个 `SELECT` 语句,该语句必须返回一个结果集。 - `EXISTS` 子查询中的条件必须使用外部查询中的列或表。 - `EXISTS` 子查询中的 `SELECT` 语句可以是任何有效的 T-SQL 查询语句,包括 `SELECT *`。 - `EXISTS` 子查询中的条件可以包含任何有效的 T-SQL 表达式和运算符。 - `EXISTS` 的性能比使用 `JOIN` 进行连接查询要高,特别是在查询大型数据集时。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值