Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

seconds87

@seconds87
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Exemplary tests for programmer candidates
    S seconds87

    Hi, I'm looking for some exemplary tests for programmer candidates, these test should be language unrelated. Does anybody know where I can find it? Thank you in advance!

    IT & Infrastructure question

  • Leasing and sponsoring .net
    S seconds87

    I'd like to thank you for help, I found the solution for first problem... I didn't know that: current lease time = MAX(lease time - expired time,renew on call time) source: http://msdn.microsoft.com/en-us/magazine/cc300474.aspx 2. You wrote: "and the actual object exists and is even outputting text onto the Server's console" yes, I know but I'd like to have a reference to this object (I want to communicate with it), this remote object is working fine (object is created and managed by client) but everything is working on "background". I have got a primitive way to comunicate with every object by static class members but it's not exactly what I want to.

    .NET (Core and Framework) csharp dotnet help

  • Leasing and sponsoring .net
    S seconds87

    Hi, Nowaday I'm working on .net remoting and I've got some problem with leasing. there is my code:

    //RemoteObject
    public class X : MarshalByRefObject
    {
    public int x;
    public X()
    {
    Console.WriteLine("some X object is done...");
    }
    public void PrintAboutMe()
    {
    ILease itfILease = (ILease)RemotingServices.GetLifetimeService(this);
    Console.WriteLine("CurrentState: " + itfILease.CurrentState);
    Console.WriteLine("InitialLeaseTime: " + itfILease.InitialLeaseTime.Minutes +
    ":" + itfILease.InitialLeaseTime.Seconds);
    Console.WriteLine("CurrentLeaseTime: " + itfILease.CurrentLeaseTime.Minutes +
    ":" + itfILease.CurrentLeaseTime.Seconds);
    Console.WriteLine("RenewOnCallTime: " + itfILease.RenewOnCallTime.Minutes +
    ":" + itfILease.RenewOnCallTime.Seconds);
    Console.WriteLine("SponsorShipTime: " + itfILease.SponsorshipTimeout.Minutes +
    ":" + itfILease.SponsorshipTimeout.Seconds);
    Console.WriteLine("x = " + x);
    }
    public override object InitializeLifetimeService()
    {
    ILease itfLease = (ILease)base.InitializeLifetimeService();
    if (itfLease.CurrentState == LeaseState.Initial)
    {
    itfLease.InitialLeaseTime = TimeSpan.FromSeconds(10);
    itfLease.RenewOnCallTime = TimeSpan.FromSeconds(6);
    itfLease.SponsorshipTimeout = TimeSpan.FromSeconds(6);
    }
    // return null;
    return itfLease;
    }
    public void IncrementX()
    {
    x++;
    Console.WriteLine("\nIncrement x member ...\n");
    }
    public void ChangeLifetime()
    {
    ILease itfILease = (ILease)RemotingServices.GetLifetimeService(this);
    itfILease.Renew(TimeSpan.FromSeconds(20));
    }
    }
    //SponsorObjectCode
    public class MySponsor : MarshalByRefObject, ISponsor
    {
    public TimeSpan Renewal(ILease il)
    {
    Console.WriteLine("I've been asked to renew the lease.");
    return TimeSpan.FromSeconds(20);
    }
    }

    //ClientCode:
    public static void Main(string[] args)
    {
    HttpChannel c = new HttpChannel(null,
    new BinaryClientFormatterSinkProvider(),
    null);
    ChannelServices.RegisterCh

    .NET (Core and Framework) csharp dotnet help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups