PDA

View Full Version : comserver: how can I act as a server?



cam
September 8th, 2008, 06:46 AM
Hi @all,

I found an example in the GirderAPI documentation (4. Communication Server Application), but I have problems as soon as my application starts to create a new CSMyServer object.

------------------ source code part ------------------
class CSMyBase : public CSBase {
public:

CSMyBase (PCHAR ServerType) : CSBase(ServerType) {};

CSConnection* CreateConnection(CSServer* Server, SOCKET s, unsigned long Address, int Port) {
CSConnection* c = new CSMyConnection(this, Server);
c -> Connect(s, Address, Port);
return c;
};

void DeleteConnection(CSConnection* Con) {delete Con;};

};

class CSMyServer : public CSServer {

public:
CSMyServer(CSBase* Base, int Port, PCHAR Password)
: CSServer(Base, Port, Password) {};
};


[...]

// Main function
CSMyBase* Base = NULL;
CSMyServer* Server = NULL;
[...]
Base = new CSMyBase("MyManager");
Server = new CSMyServer(Base, 20005, "girder"); // Problem!!!! App crashes!!!

[...]
--------------------------- end ------------------------

Where can I get an example and more information about comserverlib?


Regards
cam

Ron
September 8th, 2008, 07:43 AM
Sorry that piece should have been removed from the API docs. What are you trying to do. There is many easier ways to interact with Girder.

cam
September 8th, 2008, 08:14 AM
Hi Ron,

I integrated your comserverlib in my VS C++ applications to send status informations to Girder. This works well.

I would like to send informations and commands form one application to Girder and from Girder to my next application.

App1 -> Girder -> App2


How can I do this?


Best regards
cam

cam
September 8th, 2008, 12:29 PM
A better way?

Please let me know!

cam

Ron
September 8th, 2008, 12:31 PM
what data are you trying to send to your app?

cam
September 8th, 2008, 11:20 PM
Hi Ron,

I think the fastest way for me is you tell me the bug in my source or get an example source (comserverlib) for me.

Actually I have no time to waste.

Please help me.


cam

Ron
September 9th, 2008, 06:34 AM
As I said that should have been removed from the API as it is an internal to Girder that we might change at any time breaking your stuff. Unless you have a good reason to use this system.