Hi

I am trying to translate some client server program, I got stuck in a connect problem..

Server works well but client rfuses to connect..


InitSocket proc nPort:DWORD




mov Main.LocalSin.sin_family, AF_INET
mov Main.LocalSin.sin_port, 0

mov Main.RemoteSin.sin_family, AF_INET
invoke  htons,nPort
mov Main.RemoteSin.sin_port,ax

invoke inet_addr, addr remoteIP
mov Main.RemoteSin.sin_addr.S_un.S_addr,eax
.IF eax==INADDR_NONE
mov eax,0
ret
.endif

invoke socket,PF_INET,SOCK_STREAM,IPPROTO_TCP
mov Main.Sock,eax
.IF eax==SOCKET_ERROR
mov eax,0
ret
.endif

invoke bind, Main.Sock, addr Main.LocalSin,sizeof sockaddr_in
.IF eax==SOCKET_ERROR
mov eax,0
ret
.endif

invoke connect, Main.Sock,addr Main.RemoteSin, sizeof sockaddr_in
.IF eax==SOCKET_ERROR
mov eax,0
ret
.endif

invoke WSAAsyncSelect, Main.Sock, Main.hWnd, WM_SOCKETM, FD_READ or FD_CLOSE
mov eax ,1
ret

InitSocket endp


program is attached
Attachments:
Posted on 2005-11-08 16:56:25 by mistronr1
ok problem solved... ZoneAlarm
I did close the program but I had a process running in the background
Posted on 2005-11-08 17:55:57 by mistronr1