mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
websocket: initialize function pointers with nil
This commit is contained in:
parent
65a493d023
commit
67e30410d2
@ -2,32 +2,32 @@ module websocket
|
|||||||
|
|
||||||
// MessageEventHandler represents a callback on a new message
|
// MessageEventHandler represents a callback on a new message
|
||||||
struct MessageEventHandler {
|
struct MessageEventHandler {
|
||||||
handler SocketMessageFn // callback function
|
handler SocketMessageFn = unsafe { nil } // callback function
|
||||||
handler2 SocketMessageFn2 // callback function with reference
|
handler2 SocketMessageFn2 = unsafe { nil } // callback function with reference
|
||||||
is_ref bool // true if has a reference object
|
is_ref bool // true if has a reference object
|
||||||
ref voidptr // referenced object
|
ref voidptr // referenced object
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorEventHandler represents a callback on error
|
// ErrorEventHandler represents a callback on error
|
||||||
struct ErrorEventHandler {
|
struct ErrorEventHandler {
|
||||||
handler SocketErrorFn // callback function
|
handler SocketErrorFn = unsafe { nil } // callback function
|
||||||
handler2 SocketErrorFn2 // callback function with reference
|
handler2 SocketErrorFn2 = unsafe { nil } // callback function with reference
|
||||||
is_ref bool // true if has a reference object
|
is_ref bool // true if has a reference object
|
||||||
ref voidptr // referenced object
|
ref voidptr // referenced object
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenEventHandler represents a callback when connection is opened
|
// OpenEventHandler represents a callback when connection is opened
|
||||||
struct OpenEventHandler {
|
struct OpenEventHandler {
|
||||||
handler SocketOpenFn // callback function
|
handler SocketOpenFn = unsafe { nil } // callback function
|
||||||
handler2 SocketOpenFn2 // callback function with reference
|
handler2 SocketOpenFn2 = unsafe { nil } // callback function with reference
|
||||||
is_ref bool // true if has a reference object
|
is_ref bool // true if has a reference object
|
||||||
ref voidptr // referenced object
|
ref voidptr // referenced object
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseEventHandler represents a callback on a closing event
|
// CloseEventHandler represents a callback on a closing event
|
||||||
struct CloseEventHandler {
|
struct CloseEventHandler {
|
||||||
handler SocketCloseFn // callback function
|
handler SocketCloseFn = unsafe { nil } // callback function
|
||||||
handler2 SocketCloseFn2 // callback function with reference
|
handler2 SocketCloseFn2 = unsafe { nil } // callback function with reference
|
||||||
is_ref bool // true if has a reference object
|
is_ref bool // true if has a reference object
|
||||||
ref voidptr // referenced object
|
ref voidptr // referenced object
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user