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
|
||||
struct MessageEventHandler {
|
||||
handler SocketMessageFn // callback function
|
||||
handler2 SocketMessageFn2 // callback function with reference
|
||||
handler SocketMessageFn = unsafe { nil } // callback function
|
||||
handler2 SocketMessageFn2 = unsafe { nil } // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// ErrorEventHandler represents a callback on error
|
||||
struct ErrorEventHandler {
|
||||
handler SocketErrorFn // callback function
|
||||
handler2 SocketErrorFn2 // callback function with reference
|
||||
handler SocketErrorFn = unsafe { nil } // callback function
|
||||
handler2 SocketErrorFn2 = unsafe { nil } // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// OpenEventHandler represents a callback when connection is opened
|
||||
struct OpenEventHandler {
|
||||
handler SocketOpenFn // callback function
|
||||
handler2 SocketOpenFn2 // callback function with reference
|
||||
handler SocketOpenFn = unsafe { nil } // callback function
|
||||
handler2 SocketOpenFn2 = unsafe { nil } // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// CloseEventHandler represents a callback on a closing event
|
||||
struct CloseEventHandler {
|
||||
handler SocketCloseFn // callback function
|
||||
handler2 SocketCloseFn2 // callback function with reference
|
||||
handler SocketCloseFn = unsafe { nil } // callback function
|
||||
handler2 SocketCloseFn2 = unsafe { nil } // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user