Movatterモバイル変換


[0]ホーム

URL:


SocketIO 16.0.0 Docs (100% documented)

SocketIO Reference SocketRawView Class Reference

SocketRawView

publicfinalclassSocketRawView:NSObject

Class that gives a backwards compatible way to cause an emit not to recursively check for Data objects.

Usage:

socket.rawEmitView.emit("myEvent",myObject)
  • Send an event to the server, with optional data items.

    If an error occurs trying to transformitems into their socket representation, aSocketClientEvent.errorwill be emitted. The structure of the error data is[eventName, items, theError]

    Declaration

    Swift

    publicfuncemit(_event:String,_items:SocketData...)

    Parameters

    event

    The event to send.

    items

    The items to send with this event. May be left out.

  • Same as emit, but meant for Objective-C

    Declaration

    Swift

    @objcpublicfuncemit(_event:String,withitems:[Any])

    Parameters

    event

    The event to send.

    items

    The items to send with this event. Send an empty array to send no data.

  • Sends a message to the server, requesting an ack.

    NOTE: It is up to the server send an ack back, just calling this method does not mean the server will ack.Check that your server’s api will ack the event being sent.

    If an error occurs trying to transformitems into their socket representation, aSocketClientEvent.errorwill be emitted. The structure of the error data is[eventName, items, theError]

    Example:

    socket.emitWithAck("myEvent",1).timingOut(after:1){datain...}

    Declaration

    Swift

    publicfuncemitWithAck(_event:String,_items:SocketData...)->OnAckCallback

    Parameters

    event

    The event to send.

    items

    The items to send with this event. May be left out.

    Return Value

    AnOnAckCallback. You must call thetimingOut(after:) method before the event will be sent.

  • Same as emitWithAck, but for Objective-C

    NOTE: It is up to the server send an ack back, just calling this method does not mean the server will ack.Check that your server’s api will ack the event being sent.

    Example:

    socket.emitWithAck("myEvent",with:[1]).timingOut(after:1){datain...}

    Declaration

    Swift

    @objcpublicfuncemitWithAck(_event:String,withitems:[Any])->OnAckCallback

    Parameters

    event

    The event to send.

    items

    The items to send with this event. Use[] to send nothing.

    Return Value

    AnOnAckCallback. You must call thetimingOut(after:) method before the event will be sent.

© 2021Erik. All rights reserved. (Last updated: 2021-02-01)

Generated byjazzy ♪♫ v0.13.6, aRealm project.


[8]ページ先頭

©2009-2025 Movatter.jp