Add getPort

This commit is contained in:
Tobe O 2019-04-29 01:13:45 -04:00
parent 2738fa7e58
commit 7f70420991

View file

@ -1,8 +1,16 @@
#include "angel_wings.h"
#include "wings_socket.h"
using namespace wings;
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)