Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
I can't convert !!!!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jamal-akhtar  
View profile  
 More options Jul 13 1998, 3:00 am
Newsgroups: alt.winsock.programming
From: jamal-akh...@usa.net
Date: 1998/07/13
Subject: I can't convert !!!!
Hi,

I'm trying to create a winsock connection with a remote computer using
VB5 and api's.  I can setup the winsock and create a socket but I can
seem to connect.

My problem is that I do not have a clue how to convert a server name
such as "ftp.microsoft.com" or "pop3.myprovider.co.uk" etc to a valid
long number for the sock_addr

I've used the GetHostByNameAlias function in the WskSock.bas file but
that returns a valid long number only if the hostname I give it is in
1.2.3.4 format.  If I enter a hostname such as "pop3.mail.net" the
inet_addr( ) function, within the GetHostNameAlias( ) function,
returns a -1 so then the hostname is then passed to the gethostbyname(
) function and that returns a 0 wich in return give a INADDR_NONE

"pop3.mail.net" -->inet_addr ----> -1
"pop3.mail.net" -->gethostbyname----> 0

Somebody suggested that I use the  gethostbyname( ) to resolve the
host name into an IP address, and then use inet_ntoa( ) to convert the
IP address into the format used by Winsock but the gethostname ( )
returns a 0.

I sure it is not as difficult as it seems to convert a Host name be it
a FTP server, mail server or even a HTTP.

I will be very greatful for any help.

Thankyou

Jamal Akhtar
jamal-akh...@usa.net


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »