1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: support plain http protocol

This commit is contained in:
Delyan Angelov
2019-08-21 20:04:06 +03:00
committed by Alexander Medvednikov
parent e35ef3b83e
commit 51818346df
8 changed files with 103 additions and 35 deletions

View File

@ -231,6 +231,14 @@ pub fn (s Socket) recv(bufsize int) byteptr {
return buf
}
// TODO: remove cread/2 and crecv/2 when the Go net interface is done
pub fn (s Socket) cread( buffer byteptr, buffersize int ) int {
return int( C.read(s.sockfd, buffer, buffersize) )
}
pub fn (s Socket) crecv( buffer byteptr, buffersize int ) int {
return int( C.recv(s.sockfd, buffer, buffersize, 0) )
}
// shutdown and close socket
pub fn (s Socket) close() ?int {
mut shutdown_res := 0