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
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