English 中文(简体)
如何再利用一个有开放式特别港口的港口?
原标题:How to reuse a bound port with OpenSSL api?

I m 书写一台服务器,配有开放式服务器。 我想再利用已经使用的港口。

我可以通过呼吁制定袖珍方案来这样做。

setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));

我现在请我发言。

bind(sockfd, ...);

但是,如何在重新利用港口。 开放式SSL节目

bio = BIO_new_ssl(ctx, 0);
BIO_get_ssl(bio, &ssl);
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
abio = BIO_new_accept(server_port);
BIO_set_accept_bios(abio, bio);
BIO_do_accept(abio)

设立我的开放式特别工作组 服务器连接。

是否有任何职能,如<条码>。 能够使港口重新使用<条码>BIO*?

谢谢!

最佳回答

您可使用<条码>BIO_set_bind_mode:

BIO_set_bind_mode(abio, BIO_BIND_REUSEADDR);
问题回答

暂无回答




相关问题
how do you fix the clients outgoing port number using php?

I m using php (the sockets extension) to handle sending and receiving xml files. I d like to be able to fix the outgoing clients port number as the server has a set amount of incoming connections. I ...

Making a Ruby server work on port 80

I m creating a simple web server in Ruby, which display s the text LOLZ in the browser. I have this now: #!/usr/bin/ruby require socket server = TCPServer.open(2000) loop do client = server....

C# Discover the LocalEndPoint AddressFamily port number

When I establish a tcp connection to a server using the TcpClient class, is there any way to find out the source port of this connection? I am trying to implement the exec protocol and stderr port ...

Listen to a port that is in use [duplicate]

Possible Duplicate: Get connecting IP from specified ports that using by other program. If a port is used by a program, is there any way I can listen that port and get the connected IP on that ...

Can t access locally hosted project via the internet?

I m currently developing a Java Servlet Project in Eclipse. The project is compiled via Tomcat 5.5 and hosted in localhost:8080(alternatively 127.0.0.1:8080 AND 192.168.1.10:8080 which also happens ...

热门标签