Hi How to get ISP's IP? And can somebody explain command listen and accept Thank you greetz
Posted on 2001-06-01 14:28:00 by stanks
hi why do you want the ISP's IP?? do you mean the host you connect to using dial-up networking or the host that hosts a web page?? iczelion has a guide to winsock programming and there is a winsock1.1 and 2.0 API reference in the downloads section of this site i think. anyway, the listen and accept commands are very simple. i have only used them in non-blocking mode but here is what i know. invoke listen,sock,15 the first param is the socket descriptor i think its called. identifies the socket your using. basically its a pointer to the return value of connect. the second param is the length that the connection que (is that how you spell "Q"?) can grow to. i use 15 cos ... i just do. doesnt make much difference does it? when someone tries to connect to that port then a WM_SOCKET message is sent to your window that you specified in WSAAsyncSelect. when you receive this message move lParam into eax. then compare the lo-word (ax) to FD_ACCEPT. if it is then this means that someone has tried to connect to that port. now you can accept the conenction (if you want) eg. invoke accept,socketdesc,0,0 mov client,eax "if no error occurs, accept() returns a value of type SOCKET which is a descriptor for the accepted packet" you need to save the return value for later use in calls to other things such is send and recv. once a connection has been accepted you can begin to communicate over the port :) hope this helps. im sure there are a few things i havent got quite right that someone can put right :P skud.
Posted on 2001-06-01 14:57:00 by skud
I mean the host i connect to using dial-up. But you help me a lot Thank you skud bye
Posted on 2001-06-01 15:47:00 by stanks
"How to get ISP's IP?" well, an ISP owns alot of IPs (collective: subnet). Are you pertaining to the whole subnet (eg 123.10.10.x), or the 'www' machine (www.isp.com)?
Posted on 2001-06-02 04:49:00 by clip