Click here to Skip to main content
15,905,785 members
Home / Discussions / C#
   

C#

 
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
GeneralRe: Figured it out Using Interfaces with .NET Remoting Pin
tmagoo25-Jun-02 18:38
tmagoo25-Jun-02 18:38 
GeneralRan into a problem Pin
Brian Olej24-Jun-02 12:11
Brian Olej24-Jun-02 12:11 
GeneralRe: Ran into a problem Pin
Rama Krishna Vavilala24-Jun-02 12:29
Rama Krishna Vavilala24-Jun-02 12:29 
GeneralRe: Ran into a problem Pin
Brian Olej24-Jun-02 12:33
Brian Olej24-Jun-02 12:33 
GeneralCopying object data Pin
Zombies with Coffee, LLC24-Jun-02 9:49
professionalZombies with Coffee, LLC24-Jun-02 9:49 
GeneralRe: Copying object data Pin
Chris Rickard25-Jun-02 14:19
Chris Rickard25-Jun-02 14:19 
GeneralRe: Copying object data Pin
Zombies with Coffee, LLC25-Jun-02 16:50
professionalZombies with Coffee, LLC25-Jun-02 16:50 
GeneralRe: Copying object data Pin
Chris Rickard26-Jun-02 4:11
Chris Rickard26-Jun-02 4:11 
GeneralRe: Copying object data Pin
Zombies with Coffee, LLC26-Jun-02 4:19
professionalZombies with Coffee, LLC26-Jun-02 4:19 
GeneralPassing a ref of a form Pin
24-Jun-02 9:29
suss24-Jun-02 9:29 
GeneralRe: Passing a ref of a form Pin
Chris Rickard24-Jun-02 9:37
Chris Rickard24-Jun-02 9:37 
GeneralWhat about now?? Pin
24-Jun-02 10:53
suss24-Jun-02 10:53 
GeneralRe: What about now?? Pin
Chris Rickard24-Jun-02 12:41
Chris Rickard24-Jun-02 12:41 
GeneralHi again >:) Pin
24-Jun-02 23:58
suss24-Jun-02 23:58 
GeneralI've got it Pin
25-Jun-02 0:22
suss25-Jun-02 0:22 
GeneralDockStyle and MdiChild windows Pin
23-Jun-02 23:47
suss23-Jun-02 23:47 
GeneralRe: DockStyle and MdiChild windows Pin
Rüpel23-Jun-02 23:53
Rüpel23-Jun-02 23:53 

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.