mirror of
https://github.com/lxsang/ant-http
synced 2024-11-17 17:08:20 +01:00
add websocket support, remote terminal as example
This commit is contained in:
parent
eb63cd0fa4
commit
0c1dd101a8
13
plugins/ws.c
13
plugins/ws.c
@ -183,17 +183,4 @@ void ws_close(int client, unsigned int status)
|
||||
bytes[1] = status & 0xFF;
|
||||
_send_header(client, header);
|
||||
send(client,bytes,2,0);
|
||||
}
|
||||
int ws_status(int client)
|
||||
{
|
||||
fd_set sk;
|
||||
FD_ZERO(&sk);
|
||||
FD_SET(0, &sk);
|
||||
FD_SET(client, &sk);
|
||||
int result = select(client + 1, sk, NULL, NULL, NULL);
|
||||
if(result == 1)
|
||||
{
|
||||
return FD_ISSET(client, &sk);
|
||||
}
|
||||
return result;
|
||||
}
|
@ -24,5 +24,4 @@ void ws_b(int , uint8_t* data, int);
|
||||
void ws_close(int, unsigned int);
|
||||
void pong(int client, int len);
|
||||
int ws_read_data(int , ws_msg_header_t*, int, uint8_t*);
|
||||
int ws_status(int);
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user