forked from ryihan/Subrics-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
364 changed files
with
82,949 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using Grpc.Core; | ||
using Helloworld; | ||
|
||
namespace GreeterClient | ||
{ | ||
class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
Channel channel = new Channel("127.0.0.1:30051", ChannelCredentials.Insecure); | ||
|
||
var client = new Greeter.GreeterClient(channel); | ||
String user = "you"; | ||
|
||
var reply = client.SayHello(new HelloRequest { Name = user }); | ||
Console.WriteLine("Greeting: " + reply.Message); | ||
|
||
channel.ShutdownAsync().Wait(); | ||
Console.WriteLine("Press any key to exit..."); | ||
Console.ReadKey(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Grpc.Core; | ||
using Helloworld; | ||
|
||
namespace GreeterServer | ||
{ | ||
class GreeterImpl : Greeter.GreeterBase | ||
{ | ||
// Server side handler of the SayHello RPC | ||
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context) | ||
{ | ||
return Task.FromResult(new HelloReply { Message = "Hello " + request.Name }); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
const int Port = 30051; | ||
|
||
public static void Main(string[] args) | ||
{ | ||
Server server = new Server | ||
{ | ||
Services = { Greeter.BindService(new GreeterImpl()) }, | ||
Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } | ||
}; | ||
server.Start(); | ||
|
||
Console.WriteLine("Greeter server listening on port " + Port); | ||
Console.WriteLine("Press any key to stop the server..."); | ||
Console.ReadKey(); | ||
|
||
server.ShutdownAsync().Wait(); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
examples/csharp/HelloworldLegacyCsproj/Greeter/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#region Copyright notice and license | ||
|
||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#endregion | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
[assembly: AssemblyTitle("Greeter")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("jtattermusch")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
[assembly: AssemblyVersion("1.0.*")] | ||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] | ||
|
38 changes: 38 additions & 0 deletions
38
examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using Grpc.Core; | ||
using Helloworld; | ||
|
||
namespace GreeterClient | ||
{ | ||
class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
Channel channel = new Channel("127.0.0.1:30051", ChannelCredentials.Insecure); | ||
|
||
var client = new Greeter.GreeterClient(channel); | ||
String user = "you"; | ||
|
||
var reply = client.SayHello(new HelloRequest { Name = user }); | ||
Console.WriteLine("Greeting: " + reply.Message); | ||
|
||
channel.ShutdownAsync().Wait(); | ||
Console.WriteLine("Press any key to exit..."); | ||
Console.ReadKey(); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
examples/csharp/HelloworldLegacyCsproj/GreeterClient/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#region Copyright notice and license | ||
|
||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#endregion | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
[assembly: AssemblyTitle("GreeterClient")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("jtattermusch")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
[assembly: AssemblyVersion("1.0.*")] | ||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] | ||
|
51 changes: 51 additions & 0 deletions
51
examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Grpc.Core; | ||
using Helloworld; | ||
|
||
namespace GreeterServer | ||
{ | ||
class GreeterImpl : Greeter.GreeterBase | ||
{ | ||
// Server side handler of the SayHello RPC | ||
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context) | ||
{ | ||
return Task.FromResult(new HelloReply { Message = "Hello " + request.Name }); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
const int Port = 30051; | ||
|
||
public static void Main(string[] args) | ||
{ | ||
Server server = new Server | ||
{ | ||
Services = { Greeter.BindService(new GreeterImpl()) }, | ||
Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } | ||
}; | ||
server.Start(); | ||
|
||
Console.WriteLine("Greeter server listening on port " + Port); | ||
Console.WriteLine("Press any key to stop the server..."); | ||
Console.ReadKey(); | ||
|
||
server.ShutdownAsync().Wait(); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
examples/csharp/HelloworldLegacyCsproj/GreeterServer/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#region Copyright notice and license | ||
|
||
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#endregion | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
[assembly: AssemblyTitle("GreeterServer")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("jtattermusch")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
[assembly: AssemblyVersion("1.0.*")] | ||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] | ||
|
38 changes: 38 additions & 0 deletions
38
examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldScript.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#region Copyright notice and license | ||
|
||
// Copyright 2019 The gRPC Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#endregion | ||
|
||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class HelloWorldScript : MonoBehaviour { | ||
int counter = 1; | ||
|
||
// Use this for initialization | ||
void Start () {} | ||
|
||
// Update is called once per frame | ||
void Update() {} | ||
|
||
// Ran when button is clicked | ||
public void RunHelloWorld(Text text) | ||
{ | ||
var reply = HelloWorldTest.Greet("Unity " + counter); | ||
text.text = "Greeting: " + reply.Message; | ||
counter++; | ||
} | ||
} |
Oops, something went wrong.