i have a little ambiguity regarding a function that is wip_TCPServerCreate().This function creates a channel encapsulating a TCP Server Socket.
The prototype of the function is:
wip_TCPServerCreate(u16 port,wip_eventhandler_f spawnedHandler,void *ctx);
PORT:The port number on which TCP server socket listens.
SpawnedHandler:The callback handler that receives events related to the TCP Clients.
ctx:User data passed to the event handlers of spawned sockets.
this function returns a created channel or NULL on error but when i pass an invalid port e.g 99999 which is out of the range i.e >65535,it should return NULL rather than returning a created channel.also when i pass a valid n unused port and run my server application and then allows client application to establish a connection to server on a specfic IP and port,client is unable to establish the connection and returns with an error i.e
“error -986 on socket.closing… TCP connection”.where error number -986 indicates that timeout occurs .so there is a doubt that server application is not binding the port correctly with socket as server IP is valid and is being pinged continuously.so basically i am unable to answer two questions that why this function is taking an invalid port and successfully returning a created channel and why error of timeout is arising at client side when a valid and unused port is being passed at the server side and Server IP is also successfully pinged.
i will appreciate any assistance extended to me in this regard…anticipating an urgent response