Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C#

Name: Anonymous 2010-06-03 21:29

Anyone know a solution for the following?
I'm creating a program that has both a server and a client. Now I have both sides included in a single project.
What is the best solution for debugging this? i.e. how do I start the 2 classes at once (multiple processes/threads?).

Or would you recommend an alternate approach (splitting the project but sharing certain classes?), and is it possible to start multiple projects in a solution when debugging?

Name: Anonymous 2010-06-03 21:46

Maybe if people stop replying to these trolls they'll go away.

Name: Anonymous 2010-06-03 21:49

>>2
Why the fuck does everyone keep assuming I'm trolling?

Name: Anonymous 2010-06-03 21:50

>>2
unnecessary sage alert

>>1
I recommend hiring a Microsoft Certified Professional Developer (MCPD) to complete the job.

Name: Anonymous 2010-06-03 21:51

>>4
It's not a job, it's something I'm coding in my spare time.

NOTE: IF WHAT YOU ARE GOING TO REPLY TO THIS THREAD IS'NT CONSTRUCTIVE TOWARDS THE SOLUTION TO THE PROBLEM, DON'T. POST.
oh wait, this is 4chan... nm

Name: Anonymous 2010-06-03 21:53

>>1
You use a debugger, of course.

Alternately, implement a test program that outputs all data that is passed and processed by either side, log that, then review the logs analytically.

There are probably more elegant ways to debug a client-server application but I've always found the brute force method of telling the program to put all its cards for the time being on the table is most thorough.

Name: Anonymous 2010-06-03 21:55

>>6
I think you misunderstood me.
Currently the project runs either the server or the client class, depending on command line parameters.
What I'd like it to do, is when I start debugging in the IDE, it not only runs one of the components, but both, so I can test the interactions between the two.

Name: Anonymous 2010-06-03 21:56

>>3
Maybe it's because you keep creating shitty threads about elementary problems in C# and Access and VB and other toy bullshit on a programming board. Hint: you're the only Windows user here.
Take it to /pr/.

>>4
There is no such thing as an unnecessary sage.

>>5
oh wait, this is 4chan... nm
No it isn't. It's world4ch.

Name: Anonymous 2010-06-03 21:58

>>8
I don't use Access & VB tyvm, please stop making false assumptions.

Name: Anonymous 2010-06-03 21:59

Open up 2 instances of visual studio so you can run 2 debuggers.

Name: Anonymous 2010-06-03 22:02

Found a solution myself for multiple projects.
Solution > Set startup projects > Multiple projects

Name: Anonymous 2010-06-03 22:09

>>5
Why the fuck would you be using Cocktothorpe for a personal project? Were you dropped as a child?

Name: Anonymous 2010-06-03 22:30

>>7
That's the thing: you need to have the server component running in some manner which means you have to have a server hosting it so that you can connect to it.  You can host your own server component and just have the client component ping yourself (127.0.0.1) from the same computer.  You might want to turn the client-server program into a multithreaded program for the debugging, having a thread for the server and a thread for the client, and you could much more easily run the debugger that way, but I don't think that makes your concern any less of a concern.

In as much as I am aware of client-server programs - vaguely, admittedly - you debug them separately and then make them play together to patch up any complications.  The trick is to make sure that they can behave correctly on their own and can never/infrequently produce a message that can cause the other component to trip up.

Name: Anonymous 2010-06-03 22:32

>>12
>herp derp my language is better than yours
>what? the right tools for the right job? screw you i'm programming all my shit in assembly lol! what do you mean I'm reinventing the wheel?

how was my impression of poster #12?

Name: Anonymous 2010-06-03 22:36

>>13
Yeah, I've implemented such a solution now, thanks for your input between all the trolls here.

Since my client is a form, and my server is a console app, with commands passed through the console using reflection, I've implemented this command in the console:


public void clienttest()
{
  System.Threading.ThreadStart client = new System.Threading.ThreadStart(ctest);
  System.Threading.Thread clientthread = new System.Threading.Thread(client);
  clientthread.Start();
}

void ctest()
{
  System.Windows.Forms.Application.EnableVisualStyles();
  System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
  System.Windows.Forms.Application.Run(new Client());
}



Simple, not very elegant, but its only use will be debugging.

Name: Anonymous 2010-06-03 22:40

>>14
You don't know anything but Seshup, do you? Your handler should know better than to let you online unsupervised.

Name: Anonymous 2010-06-03 22:44

>>14
>herp derp my language is better than yours
The attitude that there's no such thing as a bad language has done more harm to programming than even the idea that anyone can be a programmer.

>what? the right tools for the right job? screw you i'm programming all my shit in assembly lol! what do you mean I'm reinventing the wheel?
Some tools aren't right for any job. You can pretend this is snobbery if it makes you feel better about the poor choices you've made in life, but trying to hammer in nails with a stick of chewing gum will leave you looking like an idiot no matter how condescending you try to be about it.

You've confirmed that you're an ignorant dipshit who has no business trying to program. Now realize that yourself and leave.

Name: Anonymous 2010-06-03 22:50

1. Cocktothorpe
2. No [code]
3. Imageboard style quoting

This guy is an obvious troll. Stop feeding him.

Name: Anonymous 2010-06-03 22:53

>>18
Sorry, I can't help it. I think deep inside, I was hoping 4chan might have a troll-free board. I was young and foolish.

Name: Anonymous 2010-06-03 23:06

Summer starts earlier every year. Let's petition Xarn to set up a hibernation board. With SexpCode and puppies.

Name: Anonymous 2010-06-03 23:14

>>20
What are we going to do with puppies?

Name: Anonymous 2010-06-03 23:15

>>21
Mourn them.

Name: Anonymous 2010-06-04 2:53

In support of >>18

Name: Anonymous 2010-06-04 7:56

It's kind of sad that /prog/ doesn't deal this well with actual retard trolls.

Don't change these.
Name: Email:
Entire Thread Thread List