Add getPort
This commit is contained in:
parent
2738fa7e58
commit
7f70420991
1 changed files with 9 additions and 1 deletions
|
@ -1,8 +1,16 @@
|
||||||
#include "angel_wings.h"
|
#include "angel_wings.h"
|
||||||
|
#include "wings_socket.h"
|
||||||
|
using namespace wings;
|
||||||
|
|
||||||
void Dart_WingsSocket_getPort(Dart_NativeArguments arguments)
|
void Dart_WingsSocket_getPort(Dart_NativeArguments arguments)
|
||||||
{
|
{
|
||||||
// TODO: Actually do something.
|
uint64_t ptr;
|
||||||
|
Dart_Handle pointerHandle = Dart_GetNativeArgument(arguments, 0);
|
||||||
|
HandleError(Dart_IntegerToUint64(pointerHandle, &ptr));
|
||||||
|
|
||||||
|
auto* socket = (WingsSocket*) ptr;
|
||||||
|
auto outHandle = Dart_NewIntegerFromUint64(socket->getInfo().port);
|
||||||
|
Dart_SetReturnValue(arguments, outHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dart_WingsSocket_write(Dart_NativeArguments arguments)
|
void Dart_WingsSocket_write(Dart_NativeArguments arguments)
|
||||||
|
|
Loading…
Reference in a new issue