MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / create

Method create

src/hx/libs/std/Socket.cpp:1077–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075 Array<int> widx;
1076
1077 void create(int nsocks)
1078 {
1079 ok = true;
1080 max = nsocks;
1081 #ifdef NEKO_WINDOWS
1082 fdr = (fd_set*)malloc(FDSIZE(max));
1083 fdw = (fd_set*)malloc(FDSIZE(max));
1084 outr = (fd_set*)malloc(FDSIZE(max));
1085 outw = (fd_set*)malloc(FDSIZE(max));
1086 fdr->fd_count = 0;
1087 fdw->fd_count = 0;
1088
1089 #else
1090 fds = (struct pollfd*)malloc(sizeof(struct pollfd) * max);
1091 rcount = 0;
1092 wcount = 0;
1093 #endif
1094
1095 ridx = Array_obj<int>::__new(max+1,max+1);
1096 HX_OBJ_WB_GET(this, ridx.mPtr);
1097 widx = Array_obj<int>::__new(max+1,max+1);
1098 HX_OBJ_WB_GET(this, widx.mPtr);
1099 for(int i=0;i<=max;i++)
1100 {
1101 ridx[i] = -1;
1102 widx[i] = -1;
1103 }
1104
1105 _hx_set_finalizer(this, finalize);
1106 }
1107
1108 void destroy()
1109 {

Callers 1

Calls 2

__newFunction · 0.85
_hx_set_finalizerFunction · 0.85

Tested by

no test coverage detected