Server application (based pn TCP socket) is not working

Hello,

I have a strangle issue. At very top level, the issue is, TCP socket based server application can not open socket on beaglebone black running angstrom. But the strange thing is, it works fine when I call socket open function in main itself. Please see details below:

Case #1)

int main()
{
/Do all required initialization and all/
/Open socket & bind/
/Listen for client/
/Accept(): At this stage, when client sends a connection request, server is able to open a socket and can communicate with client./
}

Case #2)

int start_server()
{
/Do all required initialization and all/
/Open socket & bind/
/Listen for client/
/Accept(): At this stage, when client sends a connection request, server can not able to open a socket to communicate/
}

int main()
{
start_server();
return 0;
}

Any idea? Is it stack overflow issue or something like that?

Thanks,
Ashish

I think at some point you’re going to have to show some code. The only thing that kind of makes sense is that perhaps this method is private, but then you’d have a compiler error . . . so yeah it is hard to say without seeing your code.

It definitely seems ( at least at first glance ) to be scope related. SO if you have an NDA and cant show us the ode start looking in terms of scope.

With respect to## Richard StevensAny unix programmer should start from his books

http://www.kohala.com/start/