tcp-echo server- bind() returns -1
/* Bind the socket */
if (bind(socket_descr, (struct sockaddr *)&sin,((socklen_t))sizeof(sin))< 0)
{printf("Can't bind to %s port! \n", service);}
if (type == SOCK_STREAM && listen(socket_descr, length)<0)
{printf("Can't listen on %s port! \n", service);}
NO COMPILATION ERRORS !
i am trying to write tcp-echo server but it says it cant bind to echo port...
what could be the possible error ?
thanks in advance !
|