fix WebSocket.cs, WsStream.cs, wsclient.cs

This commit is contained in:
sta
2010-10-21 01:35:50 +09:00
parent 6cd3f2ad91
commit 6b75c09ed2
26 changed files with 98 additions and 54 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#if LINUX
#if NOTIFY
using Notifications;
#endif
using System;
@@ -19,36 +19,24 @@ namespace Example
//Do something.
};
*/
ws.OnMessage += (o, e) =>
ws.OnMessage += (o, s) =>
{
#if LINUX
#if NOTIFY
ws.MsgNf.Summary = "[WebSocket] Message";
ws.MsgNf.Body = e;
ws.MsgNf.IconName = "notification-message-im";
ws.MsgNf.Show();
#else
#if NOTIFY
Notification nf = new Notification("[WebSocket] Message",
e,
s,
"notification-message-im");
nf.AddHint("append", "allowed");
nf.Show();
#endif
#else
Console.WriteLine(e);
Console.WriteLine("[WebSocket] Message: {0}", s);
#endif
};
ws.OnError += (o, e) =>
ws.OnError += (o, s) =>
{
#if LINUX
Notification nf = new Notification("[WebSocket] Error",
e,
"notification-network-disconnected");
nf.Show();
#else
Console.WriteLine("Error: {0}", e);
#endif
Console.WriteLine("[WebSocket] Error : {0}", s);
};
/*ws.OnClose += (o, e) =>
{
//Do something.

View File

@@ -1 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{52805AEC-EFB1-4F42-BB8E-3ED4E692C568}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>WsClient</RootNamespace>
<AssemblyName>wsclient</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Ubuntu|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug_Ubuntu</OutputPath>
<DefineConstants>DEBUG,NOTIFY</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Ubuntu|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release_Ubuntu</OutputPath>
<DefineConstants>NOTIFY</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
<Package>notify-sharp</Package>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="wsclient.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\websocket-sharp\websocket-sharp.csproj">
<Project>{B357BAC7-529E-4D81-A0D2-71041B19C8DE}</Project>
<Name>websocket-sharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.