Access AMIP socket server from *nix |
Access AMIP socket server from *nix |
uplate |
Oct 10 2007, 02:03 AM
Post
#1
|
Member Group: Members Posts: 21 Joined: 10-October 07 Member No.: 391 |
Hi, I am interested in trying to access AMIP from *nix. It appears that AMIP server creates a TCP socket connection that should be able to be accessed remotely. Can you give some indication on how this could be done?
I've tried with socket and telnet, but both indicate that the AMIP hosting machine refuses the connection. My setup: [WIN] AMIP Server:40581 [NIX] Client access: `telnet WIN 40581` `socket WIN 40581` Thanks |
uplate |
Nov 2 2007, 01:36 AM
Post
#2
|
Member Group: Members Posts: 21 Joined: 10-October 07 Member No.: 391 |
Hey again,
so i'm a little stuck trying to implement any kind of ClientService. I know that AMIP on my windows machine is properly transmitting commands and events, because when i run a socket tool, i get output: CODE [uplate@~/devel/src/narc/src]> socket -sl 60334 ClientServiceC//describe $active np: !!! - Heart Of Hearts [06:02m/320kbps/44kHz] if i run a program to set up an event listener, i also see stuff appear when i hit play or pause in winamp, or send a play/pause command from my *nix box using MyService IDL. however, when i try to run the following code i always get a core dump. it starts up fine, but then segfaults when i take any action in amip (play/pause/change song/etc...): CODE /* * C++ headers */ #include <RCF/Idl.hpp> #include <RCF/RcfServer.hpp> #include <RCF/TcpEndpoint.hpp> #include <iostream> /* AMIP IDLs */ #include "amip/ClientService.hpp" class NarcService { public: void exec( std::string cmd ) { std::cout << "Got exec" << std::endl; } void event( unsigned int code ) { std::cout << "Got event" << std::endl; } }; int main() { NarcService narcService; RCF::RcfServer server(RCF::TcpEndpoint(60334)); server.bind<ClientService>(narcService); server.startInThisThread(); return 0; } then this occurs when i create an event from winamp or a MyService program: CODE [uplate@~/devel/src/narc/src]> ./narcserver zsh: segmentation fault (core dumped) ./narcserver here is the gdb backtrace: CODE Starting program: /usr/home/uplate/devel/src/narc/src/narcserver warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100040] [New Thread 0x8093000 (LWP 100086)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x8093000 (LWP 100086)] 0x2825cee9 in RCF::MethodInvocationRequest::decodeFiltered () from /usr/local/lib/librcf.so (gdb) bt #0 0x2825cee9 in RCF::MethodInvocationRequest::decodeFiltered () from /usr/local/lib/librcf.so #1 0x28258c22 in RCF::MethodInvocationRequest::decodeRequest () from /usr/local/lib/librcf.so #2 0x28274164 in RCF::RcfServer::onReadCompleted () from /usr/local/lib/librcf.so #3 0x2828eed8 in RCF::TcpServerTransport::cycleRead () from /usr/local/lib/librcf.so #4 0x2828f96e in RCF::TcpServerTransport::cycle () from /usr/local/lib/librcf.so #5 0x2828fdc8 in RCF::TcpServerTransport::cycleTransportAndServer () from /usr/local/lib/librcf.so #6 0x28303f06 in boost::_mfi::mf3<bool, RCF::TcpServerTransport, RCF::RcfServer&, int, bool const volatile&>::operator() () from /usr/local/lib/librcf.so #7 0x28302eb6 in boost::_bi::list4<boost::_bi::value<RCF::TcpServerTransport*>, boost::reference_wrapper<RCF::RcfServer>, boost::arg<1> (*)(), boost::arg<2> (*)()>::operator()<bool, boost::_mfi::mf3<bool, RCF::TcpServerTransport, RCF::RcfServer&, int, bool const volatile&>, boost::_bi::list3<int&, bool const volatile&, bool&> > () from /usr/local/lib/librcf.so #8 0x283003b5 in boost::_bi::bind_t<bool, boost::_mfi::mf3<bool, RCF::TcpServerTransport, RCF::RcfServer&, int, bool const volatile&>, boost::_bi::list4<boost::_bi::value<RCF::TcpServerTransport*>, boost::reference_wrapper<RCF::RcfServer>, boost::arg<1> (*)(), boost::arg<2> (*)()> >::operator()<int, bool const volatile, bool> () from /usr/local/lib/librcf.so ---Type <return> to continue, or q <return> to quit--- #9 0x282fdf67 in boost::detail::function::function_obj_invoker3<boost::_bi::bind_t<bool, boost::_mfi::mf3<bool, RCF::TcpServerTransport, RCF::RcfServer&, int, bool const volatile&>, boost::_bi::list4<boost::_bi::value<RCF::TcpServerTransport*>, boost::reference_wrapper<RCF::RcfServer>, boost::arg<1> (*)(), boost::arg<2> (*)()> >, bool, int, bool const volatile&, bool>::invoke () from /usr/local/lib/librcf.so #10 0x282bf412 in boost::function3<bool, int, bool const volatile&, bool, std::allocator<boost::function_base> >::operator() () from /usr/local/lib/librcf.so #11 0x28272602 in RCF::RcfServer::cycle () from /usr/local/lib/librcf.so #12 0x2826ae0a in RCF::repeatCycleServer () from /usr/local/lib/librcf.so #13 0x28272204 in RCF::RcfServer::startInThisThread () from /usr/local/lib/librcf.so #14 0x28271fad in RCF::RcfServer::startInThisThread () from /usr/local/lib/librcf.so #15 0x0805ba50 in main () at narc_server.cpp:30 (gdb) i realize you do things a little differently in your code, with templating, threads, queues and stuff. that is a little advanced for me right now, so i'm trying to build my way up using the examples on the RCF website. thanks, max |