add socket

This commit is contained in:
a 2023-06-26 03:27:55 -05:00
parent ad5c721056
commit 3c51eaad96
No known key found for this signature in database
GPG Key ID: 374BC539FE795AF0

View File

@ -78,6 +78,10 @@ type TCPSocket struct {
cn context.CancelFunc
}
func (t *TCPSocket) Socket() js.Value {
return t.socket
}
// Read reads data from the connection.
// Read can be made to time out and return an error after a fixed
// time limit; see SetDeadline and SetReadDeadline.
@ -122,7 +126,7 @@ func (t *TCPSocket) Write(b []byte) (n int, err error) {
}
// StartTls will call startTls on the socket
func (t *TCPSocket) Close() error {
func (t *TCPSocket) StartTls() error {
t.socket.Call("startTls")
return nil
}