This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Porting to mbed
SaeHie Park edited this page Dec 11, 2015
·
6 revisions
While making libtuv run on mbed, these are the tweaks that I am trying, not knowing much about mbed...
Timer
runs in nano seconds but overflows in about 30 minutes. Try use accumulation value of timer every uv__hrtime
call.
hum...
file descriptor? mbed don't have this
- emulate with object index.
- can have problems. fix when it happens.
for network, onreadble
, onsent
and ondisconnect
callback.
Call stack when client is force disconnected in linux.
uv_shutdown() at uv_unix_stream.c:959 0x8074f68
after_read() at echo_server.c:102 0x8064bdf
uv__stream_eof() at uv_unix_stream.c:434 0x8073e6b
uv__read() at uv_unix_stream.c:911 0x8074d62
uv__stream_io() at uv_unix_stream.c:503 0x8074030
uv__io_poll() at uv_linux_io.c:236 0x8076c42
uv_run() at uv_run.c:167 0x806c538
and then for io watcher
after_shutdown() at echo_server.c:81 0x8064997
uv__drain() at uv_unix_stream.c:412 0x8073d22
uv__stream_io() at uv_unix_stream.c:531 0x80740df
uv__io_poll() at uv_linux_io.c:236 0x8076c42
uv_run() at uv_run.c:167 0x806c538
- mbed socket connect is async. uv handles
EINPROGRESS
asnot a problem
, so return -1 withEINPROGRESS
- connection starts at
uv__tcp_connect()
- this is monitored with io with
uv__tcp_connect
- when
poll
detects connection,uv__stream_connect()
is called throughuv__stream_io()
- connection state is checked with
tuvp_getsockopt()
so, must implementSOL_SOCKET
+SO_ERROR