0

Tell me please, i'm trying to figure out if Liebevent can use ipiv6. At the moment I am reading about Bufferevents:concepts and basics: Bufferevents:concepts and basics

There says that:

If the bufferevent’s socket is not yet connected, you can launch a new connection.

bufferevent_socket_connect(struct bufferevent *bev,struct sockaddr *address, int addrlen);

The address and addrlen arguments are as for the standard call connect().

I'm confused by the structure - sockaddr, since she has no fields for ip v6.

And so I can't figure out how to enter information about IPv6?

Optimus1
  • 444
  • 2
  • 13
  • Does this answer your question? [libevent evhttp and ipv6](https://stackoverflow.com/questions/14837107/libevent-evhttp-and-ipv6) – Nick ODell Dec 21 '21 at 19:18
  • @Nick ODell, Unfortunately no. – Optimus1 Dec 21 '21 at 19:22
  • Sounds like you need a good introduction to socket programming like W. Richard Stevens' Unix Network Programming or Beej's Guide. – Shawn Dec 21 '21 at 19:40
  • You need a struct sockaddr_in6. Note that sockaddr has to be specialized for the specific protocol used. – stark Dec 21 '21 at 19:42
  • @stark, yes I know that for IPv6 the structure is used sockaddr_in6, but the bufferevent_socket_connect function accepts a "sockaddr" structure as input. – Optimus1 Dec 21 '21 at 20:04
  • @Shawn, no, I don’t need it. – Optimus1 Dec 21 '21 at 20:05
  • @stark, I think I figured out bufferevent_socket_connect (), just like WSAConnect () takes a structure and sockaddr_in and sockaddr_in6 are cast to a pointer to a structure (sockaddr *) – Optimus1 Dec 21 '21 at 20:23
  • If you don't understand how sockaddr structs work... Yes, you do. – Shawn Dec 21 '21 at 20:55

0 Answers0