how to approach ...

.net , cpp United States
  • 18 years ago

    So,
    Wanna multlple client apps connected to server app using same port...
    Read some documentation and I guess that "one thread per client" will do it...


    Some experience in this guys ?
    Can share me some ideas ?
    ANYTHING   !!


    (I'm posting here because "low-level" programmers hang out arounf c++...This app I'm doing is dev. in C#)



    Xcuse my english and Thanx !!

  • 18 years ago

    You want to know how this would be done in C#? Or just a general approach to it?


  • 18 years ago

    general ideas will be coll





    thanx

  • 18 years ago

    C#? take a look at remoting


    http://www.dotnetremoting.cc/DotNetCentric/Articles/Remotingvs.ASP.NETWebServ.asp


    remoting lets you leverage the .NET framework to access classes through atcp or http channels.
    Remoting needs a server to host the application, this can be IIS or an app you write,
    for example, running a server application on a tcp port 5086 would be
              System.Runtime.Remoting.Channels.Tcp
    running on http would be:
              System.Runtime.Remoting.Channels.Http


    Code:

    using System;
    using System.Runtime.Remoting;
    using System.Runtime.Remoting.Channels;
    using System.Runtime.Remoting.Channels.Tcp;


    namespace RemotingSamples {
       public class Sample {
           public static int Main(string [] args) {
               TcpChannel chan = new TcpChannel(8085);
               ChannelServices.RegisterChannel(chan);
               RemotingConfiguration.RegisterWellKnownServiceType(
                   Type.GetType("RemotingSamples.HelloServer,object"),
                   "SayHello", WellKnownObjectMode.SingleCall);
               System.Console.WriteLine("Hit  to exit...");
               System.Console.ReadLine();
               return 0;
           }
       }
    }



    Something else to look at might be web services


    hope that helps.


    .fri

  • 18 years ago

    thanx fry for the reply.


    ...Using C# I have created a COM server and a COM client.I succeded in calling a server COM objects methods.Works just fine.My application is a bit complicated (from this point of view) because an server app(COM client) will have to make queryes on several client applications (COM servers).And my problem is doing that thing thru same port(TCP port)...I read some and (just from reading) I guess that creating a thread for each client-server connection will be an cool solution (one thread per client)...

    If you have any experience in that field please share me some,or let me ask you some questions...


    Thanx again!
    Xcuse my english

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Owning a computer without programming is like having a kitchen and using only the microwave oven” - Charles Petzold