parent
136967659a
commit
ad46c0592b
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
//#define EXAMPLE_SSL
|
//#define EXAMPLE_SSL
|
||||||
|
|
||||||
#define port "8000"
|
#define port 8000
|
||||||
|
|
||||||
static void hello_action(struct uh_client *cl)
|
static void hello_action(struct uh_client *cl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,12 +57,12 @@ static void uh_accept_cb(struct uloop_fd *fd, unsigned int events)
|
||||||
uh_accept_client(srv, srv->ssl);
|
uh_accept_client(srv, srv->ssl);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct uh_server *uh_server_new(const char *host, const char *port)
|
struct uh_server *uh_server_new(const char *host, int port)
|
||||||
{
|
{
|
||||||
struct uh_server *srv = NULL;
|
struct uh_server *srv = NULL;
|
||||||
int sock = -1;
|
int sock = -1;
|
||||||
|
|
||||||
sock = usock(USOCK_TCP | USOCK_SERVER | USOCK_IPV4ONLY, host, port);
|
sock = usock(USOCK_TCP | USOCK_SERVER | USOCK_IPV4ONLY, host, usock_port(port));
|
||||||
if (sock < 0) {
|
if (sock < 0) {
|
||||||
uh_log_err("usock");
|
uh_log_err("usock");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -41,6 +41,6 @@ struct uh_server {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct uh_server *uh_server_new(const char *host, const char *port);
|
struct uh_server *uh_server_new(const char *host, int port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue