PDA

View Full Version : Issue with server connection



Dwyguy
03-14-2014, 05:17 PM
Hey all, I'm slowly learning ClanLib and doing an old tutorial (http://codegrind.net/2010/10/05/clanlib-tutorial-part-3-network-basics/) as part of the process. I am down to the part where I have created the client and server to test connecting. I am using ClanLib 3.0.1, so I made the necessary changes to get rid of syntax errors. However, when I go to build the project, I receive the following error:


server.cpp
1>c:\development\environment\clanlib\include\clanlib \core\signals\slot_container.h(105): error C2660: 'clan::Signal_v2<Param1,Param2>::connect' : function does not take 2 arguments
1> with
1> [
1> Param1=clan::NetGameConnection *,
1> Param2=const std::string &
1> ]
1> c:\users\matthew\documents\visual studio 2010\projects\clanlibtest\clientservertest\server. cpp(8) : see reference to function template instantiation 'void clan::SlotContainer::connect<clan::Signal_v2<Param1,Param2>,Server,clan::NetGameConnection*>(SigClass &,Class *,void (__thiscall Server::* )(Param1))' being compiled
1> with
1> [
1> Param1=clan::NetGameConnection *,
1> Param2=const std::string &,
1> SigClass=clan::Signal_v2<clan::NetGameConnection *,const std::string &>,
1> Class=Server
1> ]


I cannot for the life of me figure out what is going on here, and why the project will not build. The lines in question are in the constructor:



Server::Server()
{
slots.connect(network_server.sig_client_connected( ), this, &Server::on_client_connected);
slots.connect(network_server.sig_client_disconnect ed(), this, &Server::on_client_disconnected);
slots.connect(network_server.sig_event_received(), this, &Server::on_event_received);
}

Is anyone able to tell me what I need to change?

rombust
03-18-2014, 06:52 AM
void Server::on_client_disconnected(NetGameConnection *connection, const std::string &message)

"const std::string &message" was added at some point


Sorry for slow reply, for some reason your post was "moderated" waiting for approval