Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace moa.test.remote.client {
- /// <summary>
- ///
- /// </summary>
- class MoaRemoteClientSample {
- /// <summary>
- ///
- /// </summary>
- /// <param name="args"></param>
- public void run(string[] args) {
- Console.WriteLine( "client start" );
- Console.WriteLine( AppDomain.CurrentDomain.SetupInformation.ApplicationName.ToString() );
- Console.Write( "regist start, please enter " );
- Console.ReadKey();
- RemoteClient client = new RemoteClient();
- IRemoteObject server_remote_object = client.createRemoteScreenObject( "localhost",
- "remortobj",
- typeof( IRemoteObject )
- ) as IRemoteObject;
- RemoteObject client_remote_object = new RemoteObject();
- client_remote_object.sendMessage += new SendMessageEventHandler( messageSend ); // たぶんクライアントでうごいてる
- server_remote_object.sendMessage += new SendMessageEventHandler( client_remote_object.onMessageSend ); // たぶんサーバでうごいてる
- //server_remote_object.sendMessage += new MesSendEventHandler( messageSend );<-これだけだとサーバ内で発生
- Console.WriteLine( "regist messageSend success" );
- Console.ReadKey();
- server_remote_object.onMessageSend();
- Console.ReadKey();
- }
- /// <summary>
- ///
- /// </summary>
- static void messageSend() {
- //Console.WriteLine( AppDomain.CurrentDomain.SetupInformation.ApplicationName.ToString() );
- Console.WriteLine( "クライアント待ちうけイベントだよっ!" );
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="args"></param>
- static void Main(string[] args) {
- MoaRemoteClientSample progn = new MoaRemoteClientSample();
- progn.run( args );
- }
- }
- }
Add Comment
Please, Sign In to add comment