sock binding on *nix vs w98
on server side function in main
_sock_addr * sock_addr = new _sock_addr ("127.0.0.1", 10000);
_sock_addr * sock_dest = new _sock_addr ();
_sock * sock = new _sock (SOCK_DGRAM);
sock->bind (sock_addr);
this is a bind using global
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
void _sock::bind (_sock_addr * addr)
{
int error = ::bind (sd, reinterpret_cast (addr->get_addr()), sizeof (struct sockaddr_in));
if(error == -1)throw _sock_exception ("_socket::bind - could not bind socket to a provided name");
}
On my Bamboo(mdk 9.1) it wont work
error after bind called says:
name already in use
I havn''t documentation on sok programming with linux
Equ code on w98 work just fine both the server and the client
since it is loop it must work
Any comment whats wrong?
Can''''t be root?Reboot!
mount -r /home/hell
Can't be root?Reboot!mount -r /home/hell
August 08, 2003 12:10 PM
netstat -an
it sounds like something is already listening on that port.
it sounds like something is already listening on that port.
Yep
Thanks
It is realy what you says
error 98
Because Closing terminal window probably not killing the process?
So on next server start it fail in bind .
Probably Only One can be binded to specified port?
Can''''t be root?Reboot!
mount -r /home/hell
Thanks
It is realy what you says
error 98
Because Closing terminal window probably not killing the process?
So on next server start it fail in bind .
Probably Only One can be binded to specified port?
Can''''t be root?Reboot!
mount -r /home/hell
Can't be root?Reboot!mount -r /home/hell
August 13, 2003 06:24 PM
The listening socket will persist or a while after the application exits. You can set a specific sock option to stop it from doing that. I don''t remember what the option was, I only remember that it''s not recommended.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement