Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralInvoke members Pin
Wizard_0126-Jun-02 5:41
Wizard_0126-Jun-02 5:41 
GeneralRe: Invoke members Pin
Chris Rickard26-Jun-02 7:44
Chris Rickard26-Jun-02 7:44 
GeneralRe: Invoke members Pin
Wizard_0126-Jun-02 8:23
Wizard_0126-Jun-02 8:23 
GeneralRe: Invoke members Pin
Chris Rickard26-Jun-02 8:26
Chris Rickard26-Jun-02 8:26 
GeneralOracle and .NET Pin
SimonS26-Jun-02 0:52
SimonS26-Jun-02 0:52 
GeneralRe: Oracle and .NET Pin
Andy Smith26-Jun-02 5:58
Andy Smith26-Jun-02 5:58 
GeneralRe: Oracle and .NET Pin
SimonS27-Jun-02 0:54
SimonS27-Jun-02 0:54 
GeneralCalling DLL's Pin
Venet25-Jun-02 23:05
Venet25-Jun-02 23:05 
GeneralRe: Calling DLL's Pin
Rüpel25-Jun-02 23:11
Rüpel25-Jun-02 23:11 
GeneralRe: Calling DLL's Pin
Zombies with Coffee, LLC26-Jun-02 4:22
professionalZombies with Coffee, LLC26-Jun-02 4:22 
GeneralRe: Calling DLL's Pin
Venet26-Jun-02 5:09
Venet26-Jun-02 5:09 
GeneralRe: Calling DLL's Pin
Zombies with Coffee, LLC26-Jun-02 5:30
professionalZombies with Coffee, LLC26-Jun-02 5:30 
GeneralRe: Calling DLL's Pin
Venet26-Jun-02 6:13
Venet26-Jun-02 6:13 
GeneralVS.Net Webforms designer - How-to Pin
alper25-Jun-02 21:20
alper25-Jun-02 21:20 
QuestionHow to dispaly "Systeminformation" dialog? Pin
Feng Qin25-Jun-02 18:15
Feng Qin25-Jun-02 18:15 
AnswerRe: How to dispaly "Systeminformation" dialog? Pin
Chris Rickard26-Jun-02 4:54
Chris Rickard26-Jun-02 4:54 
GeneralRe: How to dispaly "Systeminformation" dialog? Pin
Feng Qin26-Jun-02 16:21
Feng Qin26-Jun-02 16:21 
GeneralCustom web control Pin
25-Jun-02 15:46
suss25-Jun-02 15:46 
GeneralRe: Custom web control Pin
Rocky Moore25-Jun-02 17:10
Rocky Moore25-Jun-02 17:10 
GeneralTimeZone Pin
Chris Melinn25-Jun-02 13:45
Chris Melinn25-Jun-02 13:45 
GeneralRe: TimeZone Pin
Chris Rickard25-Jun-02 14:58
Chris Rickard25-Jun-02 14:58 
GeneralResource files and user types Pin
25-Jun-02 0:18
suss25-Jun-02 0:18 
GeneralRe: Resource files and user types Pin
Chris Rickard26-Jun-02 4:41
Chris Rickard26-Jun-02 4:41 
GeneralThanks! Pin
3-Jul-02 7:32
suss3-Jul-02 7:32 
GeneralUsing Interfaces with .NET Remoting Pin
tmagoo24-Jun-02 19:34
tmagoo24-Jun-02 19:34 
I have created a simple client/server remoting interface that basically allows the client to get a byte array from the server. I am wanting to develop something that will allow the main thread on the server to initialize a byte array and allow the client to access this byte array from the interface. Does anyone have experience doing such a thing? Below is an example of what I want to do; but, don't know how to make it work. Look for initialization and How do I do this within the code comments.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using RemoteInterfacecls; //Code not proviced at this time
using System.Runtime.Serialization;

namespace RemotingInterfaceServer
{

public class dataStuff
{
public byte [] mystuff;
}

public class EntryPoint
{

public static void Main(string[] args)
{
dataStuff dS = new dataStuff();

//Here is the initializaton
ds.mystuff = System.Text.Encoding.ASCII.GetBytes("This is a test");

TcpServerChannel channel = new TcpServerChannel(2566);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(RemoteExample),
"RemoteExample", WellKnownObjectMode.SingleCall);
System.Console.WriteLine("Hit Key to Exit");
System.Console.ReadLine();
}
}

public class RemoteExample : MarshalByRefObject, IRemoteExample
{
public RemotingExample()
{
Console.WriteLine("Constructor Called ");
}

public IByteArray GetByteArray()
{
ByteArray byteArray;

//This is the from the main initialization
// How do I do this ???????????
byteArray.bytesRead = mystuff;
return (IByteArray)byteArray;
}

}

[Serializable]
public class ByteArray : MarshalByRefObject, IByteArray
{
public byte [] bytesRead;

}



Tom McDaniel

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.