Home Forums Support [Help] Custom Class and Coding

Viewing 10 posts - 1 through 10 (of 12 total)
  • Author
    Posts
  • #3570
    Anonymous
    Inactive

    Hello NCN-Team,
    I want to ask if its possible that someone writes a simmple server and a simple client application which are not mixed with each other like in the exambles.. thats just confusing >.<

    And maybe show howto:
    -Multiple Clients send a filled class of commands to the server and the server just logs it or sends any message back.

    namespace Server
    {
        public enum CMDs
        {
            SendFileList,
            SendFolderList,
            SendFile,
            StepIntoFolder,
            GoHomeFolder,
            DoNothing
        }
    
        
        public class ServerCommands
        {       
            private CMDs _CurrentCommand;
    
            public CMDs CurrentCommand
            {
                get
                {
                    return _CurrentCommand;
                }
                set
                {
                    _CurrentCommand = value;
                }
            }
        }
    }

    basicly I want to code something like:
    A client connects to the server.exe and you can send through the client a command like ‘SendFile’ + Filename
    and the server.exe sends a specific file back to the client. (means the onliest thing what the server does is receiving commands and sends files to the client plus sends ‘List<string>’ to the client for something like a file-browser that you can just double-click at any file at the client window and you get it from the server)

    ImageToExplainTheText

    Your idea of such a lib is realy great, but you confuse me with mixing up server and client to once -.-
    Hope you can assist me, I would spend a bit money to the guy who helps on paypal 🙂

    • This topic was modified 7 years, 11 months ago by .
    • This topic was modified 7 years, 11 months ago by .
    #3573
    Anonymous
    Inactive

    tried now some hours to get it work, but if I try it, nothing happens or the client tells me that the handle of anything is not set-ed up correctly -.- I could upload the source if it helps zzzz

    #3582
    Anonymous
    Inactive

    so no-one is willing to help. very bad support.

    • This reply was modified 7 years, 11 months ago by .
    #3588
    Anonymous
    Inactive

    Heya Georg,

    Sorry for the slow reply. We have included many examples in the download bundle starting from the most simple, which is only 11 lines long, up to advanced which demonstrates the more sophisticated features available in NetworkComms.Net. Most of the simple example are structured like this:

    bool server = true;
    
    if (server) {
        //Do server stuff
    } else {
        //Do clientstuff
    }
    

    It should be relatively easy to split these into completely independant examples. I would recommend however that you do not think of servers and clients as separate objects, just two applications that communicate with each other, both are capable of sending and receiving, that might help.

    Unfortunately I am not able to offer anything more simple than what is already provided in the examples. If you have any specific questions about something you do not understand in the examples I would be happy to explain it.

    Kind regards,
    Marc

    #3589
    Anonymous
    Inactive

    i did that but i dont know what im doing wrong in sending and receiving, its like this in the file-sending examble Oo

    [deleted]

    here you can see my project, i will delete the link later on after you watched at it (think only costumers can see this forum)

    • This reply was modified 7 years, 10 months ago by .
    #3615
    Anonymous
    Inactive

    so basicly you removed the link, can you tell me where the mistake is ?? Oo

    #3618
    Anonymous
    Inactive

    Heya Georg,

    The support you need is really outside of our ability to offer for free here. We generally struggle to answers questions along the lines of ‘I want to build this, please show me how’, as they take up excessive amounts of our time, e.g. hours.

    We do have paid for support agreements that we offer for exactly this kind of support. If we gave you a significant amount of time it would be be unfair on those who bought the support.

    If you come across any bugs we will of course always spend time on these. We also spent ALOT of time putting together all of the example included in NetworkComms.Net. Have you also seen the walkthrough tutorials we created https://networkcomms.net/tutorials/?

    Regards,
    Marc

    #3630
    Anonymous
    Inactive

    you show here howto send costum objects:

    Custom Objects


    NetworkComms.SendObject("Message", "127.0.0.1", 10000, myCustomObject);
    but not how to receive them correctly on a incomming connection >.<
    And I dont rly get whatfor the first param ist O_o means ‘”Message”‘ do I need exactly the same string
    for receiving ? and what would be a correct receiving ?

    #3638
    Anonymous
    Inactive

    NetworkComms.Net does not infer the receiving data type. As such when you expect to receive an object you need to tell NetworkComms.Net what type it is going to be. In the case of the simple examples this is always a string, i.e. you see something like this:

    NetworkComms.AppendGlobalIncomingPacketHandler<string>("Message" ...

    Here you are telling NetworkComms.Net that you will be receiving a type of <string>, and that string will be sent with a packet type of "Message". For more information on this syntax I recommend you read about Generics, http://www.dotnetperls.com/generic.

    Regards,
    Marc

    #3644
    Anonymous
    Inactive

    -.-

        void ProcessServerStart() 
            {
                //Trigger IncomingPartialFileData method if we receive a packet of type 'PartialFileData'
                NetworkComms.AppendGlobalIncomingPacketHandler<ServerCommands>("ServerCommands", IncomingCommandData);           
    
                //Trigger the method OnConnectionClose so that we can do some clean-up
                NetworkComms.AppendGlobalConnectionCloseHandler(OnConnectionClose);
    
                Connection.StartListening(ConnectionType.TCP, new IPEndPoint(IPAddress.Parse(gServerInfo.IP), Convert.ToInt32(gServerInfo.Port)));            
            }

    doing it already like this zzz

Viewing 10 posts - 1 through 10 (of 12 total)
  • You must be logged in to reply to this topic.