invoke accept,hSocket,ADDR ClientAddress,ADDR ClientLen
invoke inet_ntoa, ADDR ClientAddress.sin_addr <- dont work
invoke inet_ntoa, ADDR ClientAddress.sin_addr.S_un.S_addr <- same :(
Ideas?
invoke inet_ntoa, ADDR ClientAddress.sin_addr <- dont work
invoke inet_ntoa, ADDR ClientAddress.sin_addr.S_un.S_addr <- same :(
Ideas?
All network related posts should be posted in the networking section..
but anyways, i guess you are using accept on the FD_READ message.
try:
corrected the code, see Thomas' code below ;)
but anyways, i guess you are using accept on the FD_READ message.
try:
invoke accept,[b]wParam[/b],addr ClientAddress,addr ClientLen
invoke inet_ntoa, ClientAddress.sin_addr.S_un.S_addr
;eax is now a pointer to the ip string
;invoke MessageBox, hDlg, eax, 0, MB_OK
corrected the code, see Thomas' code below ;)
I moved thread.
I dont use a window or dialog ... nor FD_ACCEPT or FD_READ
SOCKET PASCAL FAR accept ( SOCKET s, struct sockaddr FAR * addr, int FAR * addrlen );
s A descriptor identifying a socket which is listening for
connections after a listen().
.....
The argument addr is a result parameter that is filled in with the address of the connecting entity, as known to the communications layer.
:?
SOCKET PASCAL FAR accept ( SOCKET s, struct sockaddr FAR * addr, int FAR * addrlen );
s A descriptor identifying a socket which is listening for
connections after a listen().
.....
The argument addr is a result parameter that is filled in with the address of the connecting entity, as known to the communications layer.
:?
Remove 'ADDR' in the inet_ntoa calls.
Thomas
Thomas
invoke inet_ntoa, ClientAddress.sin_addr
error A2114: INVOKE argument type mismatch : argument : 1
then
push ClientAddress.sin_addr
call inet_ntoa
IT WORKS!!
thx a lot :)
error A2114: INVOKE argument type mismatch : argument : 1
then
push ClientAddress.sin_addr
call inet_ntoa
IT WORKS!!
thx a lot :)
This should worl:
The sin_addr member is a in_addr structure, and inet_ntoa wants a dword so you have to use the union inside to tell masm it's a dword.
Thomas
invoke inet_ntoa, ClientAddress.sin_addr.S_un.S_addr
The sin_addr member is a in_addr structure, and inet_ntoa wants a dword so you have to use the union inside to tell masm it's a dword.
Thomas