Author Topic: How to test a server and a client?  (Read 10873 times)

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
How to test a server and a client?
« on: November 09, 2009, 10:05:47 am »
The server uses sockets and listens for request messages issued by a client program.
Eventually, the server will run on a remote machine, but at the moment it runs on the same PC as the client and communicates via localhost loopback.

I start the server program from the Linux/Ubuntu command line and then the client program from codeblocks. I debug, single-step, watch variables etc on the client via codeblocks and use printf on the server. Using printf is tedious, so it would be nice to be able to use codeblocks on both server and client when both are active.

Starting the server from the Ubuntu menu, Applications->Programming->Codeblocks works fine, but when I try the same for the client program nothing happens, i.e. there is no second instance of codeblocks appearing for the client.

How can I debug both server and client using codeblocks?


zabzonk

  • Guest
Re: How to test a server and a client?
« Reply #1 on: November 09, 2009, 10:13:24 am »
Make sure that Settings|Environment|General Settings|Allow only one instance is unchecked.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to test a server and a client?
« Reply #2 on: November 09, 2009, 10:36:58 am »
And if it's a newer version of C::B (aka a nightly), uncheck also "Use an already running instance (if possible)" in the "Interprocess ..." frame just below.

zabzonk

  • Guest
Re: How to test a server and a client?
« Reply #3 on: November 09, 2009, 10:47:04 am »
Jens, could you give a one-line explanation of what that setting actually does? The box surrounding it sems to suggest it has something to to with DDE, which I wouldn't have thought anyone was using anymore (especially on Linux).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to test a server and a client?
« Reply #4 on: November 09, 2009, 11:03:10 am »
On windows it's dde, on linux ipc via unix-socket.
It's needed to open a file from your file-explorer (explorer on windows or nautilus, thunar, etc. on linux) in an already opened C::B instance.

See also the C::B-manual chapter 1.11.2 .

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: How to test a server and a client?
« Reply #5 on: November 09, 2009, 12:09:45 pm »
Zabzonk & Jens:

Many thanks.

I can now debug both server and client using codeblocks.
Great!