荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑), 信区: Program
标  题: MSVC Digest - 21 May 1998 to 22 May 1998
发信站: BBS 荔园晨风站 (Mon May 25 18:13:09 1998), 转信

There are 5 messages totalling 313 lines in this issue.

Topics of the day:

  1. Is Your Web Site Posted?
  2. Random Numbers (More details).
  3. Sockets (2)
  4. DOH!

--------------------------------------------------------------------------
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription info and archives,
see http://peach.ease.lsoft.com/archives/msvc.html .  For LISTSERV sales
information, see http://www.lsoft.com or write to SALES@LSOFT.COM.

----------------------------------------------------------------------

Date:    Fri, 22 May 1998 08:40:51 -0400
From:    site@SITEPOSTER.COM
Subject: Is Your Web Site Posted?

To: MSVC@PEACH.EASE.LSOFT.COM

     Is Your Web Site Posted?
     SitePoster will post your site to 50 search engines for $89.
     We guarantee your satisfaction, or you pay nothing!

Millions of people every day use search engines to find web sites.
SitePoster makes your site easier to find by posting it to the top 50 search eng
ines.

Here's how it works:

1.  Fill out the form below, and return it to us.

2.  We'll post your site to the top 50 search engines within two business days a
nd send
you a full promotion report.

3.  Pay nothing now.  We'll send you a bill for $89 with the promotion report.
If you're
not completely happy, simply write "cancel" on the bill, and you'll owe nothing.


THE SEARCH ENGINES

Here's the list of top search engines to which we'll post your site:

Alta Vista, Excite, Galaxy, HotBot, Infoseek, Lycos, Magellan, Open Text Web Ind
ex,
Web Crawler, BizWeb, New Riders WWW Yellow Pages, LinkMonster, True North,
Northern Light, YelloWWWeb, The Weekly Bookmark, The Galactic Galaxy, TurnPike,
Unlock:The Information Exchange, Your WebScout, Manufacturers Information
Network, Net Happenings, Net Mall, Web World  Internet Directory, WebVenture
Hotlist, What's New, WhatUSeek, JumpLink, Linkcentre Directory, InfoSpace, Jayde

Online Directory, BC Internet, BizCardz Business Directory, Net-Announce, New Pa
ge
ListOne World Plaza, PageHost A-Z, PeekABoo, Project Cool, Scrub The Web, Seven
Wonders, Sserv, Starting Point, Web 100, Web Walker, Where2Go, World Wide Busine
ss
Yellow Pages, Wow! Web Wonders!, WWW Worm, JumpCity.

ORDER FORM

Hit the REPLY button on your e-mail program and fill out the following informati
on.
 (This information will be posted to the search engines/indexes):

URL:  http://
Site Title:
Description (250 characters):

Key words (250 characters, in descending order of importance):

Your name:
Company Name:
Address:
City:              State/Prov:     Zip/Postal Code:
Telephone:
Fax:
Email address:

Contact e-mail address (in case we have questions about this order):

If  billing a different address, please complete the following:

Addressee:
Company Name:
Address:
City:              State/Prov:     Zip/Postal Code:
Telephone:
Fax:
Email address:

TERMS

Terms are net 15 days from date of invoice.

______________________________________________________________________
SitePoster, Inc.
1440 Whalley Avenue - Suite 239
New Haven, CT 06515
Phone: (203) 928-9207
Fax:     (203) 389-8074
E-mail: site@siteposter.com

------------------------------

Date:    Fri, 22 May 1998 10:17:21 +0300
From:    hany <hanyhibs@MAIL.FORFREE.AT>
Subject: Random Numbers (More details).

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01BD856A.CE75DBE0
Content-Type: text/plain;
        charset="iso-8859-6"
Content-Transfer-Encoding: quoted-printable

Thanks L.Balaji for your respond.
Would you or anyone from the list give  a more detailed help.

Thanks alot.

Hany


------=_NextPart_000_000D_01BD856A.CE75DBE0
Content-Type: text/html;
        charset="iso-8859-6"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3D"text/html; charset=3Dwindows-1256" =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2201.0"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT color=3D#000000 size=3D2>Thanks L.Balaji for your =
respond.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>Would you or anyone from the lis
t =
give? a=20
more detailed help.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>?</DIV>
<DIV><FONT size=3D2>Thanks alot.</FONT></DIV>
<DIV><FONT size=3D2></FONT>?</DIV>
<DIV><FONT size=3D2>Hany</FONT></DIV>
<DIV><FONT size=3D2></FONT>?</DIV></BODY><
/HTML>

------=_NextPart_000_000D_01BD856A.CE75DBE0--

------------------------------

Date:    Fri, 22 May 1998 22:04:06 -0500
From:    Ramonator <ramon@CUTEANDCUDDLY.COM>
Subject: Sockets

This may sound way lame, but can anybody take me step by step sort of on
how
to create and bind a socket and then send data and receive it?
I would greatly appreciate any help.

thanks

------------------------------

Date:    Sat, 23 May 1998 08:49:44 +0530
From:    Shakthimani <shakthi@USA.LTINDIA.COM>
Subject: Re: Sockets

This is a multi-part message in MIME format.
--------------F0525E5361B7846E17B73851
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hai,
iam sending you a complete code for client and server seperately.I think this
should give you a good start.This example creates a non blocking socket .You
can similarly try for a blocking socket by removing ioctlsocket () in the
server and removing while loops for accept and recv calls.

//////////////////////////////////////client////////////////////////////////////
//////////////////////////////////////////////////////

#include<Winsock2.h>
#include<stdio.h>

void main(void)
{
 SOCKET clihandle;
 struct sockaddr_in serv_addr;
 u_long hr;
 char buff[40000];

 strcpy(buff,"123456789 1234567890 1234567890 1234567890 1234567890 1234567890
");

 serv_addr.sin_family=PF_INET;
 serv_addr.sin_port=htons(6000);
    serv_addr.sin_addr.s_addr=inet_addr("10.1.51.68");

 WORD wVersionRequested;
 WSADATA wsaData;
 int err;
  wVersionRequested = MAKEWORD( 2, 0 );
  err = WSAStartup( wVersionRequested, &wsaData );

 clihandle=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);

 hr=connect(clihandle,(struct sockaddr*)&serv_addr,sizeof(serv_addr));
 hr=WSAGetLastError();
 hr=send(clihandle,buff,200,0);
 hr=WSAGetLastError();
// Sleep(30000);
 closesocket(clihandle);
 WSACleanup();
}
/////////////////////////////////////////////////////////////server/////////////
///////////////////////////////////////////////////////////////////////////

#include<Winsock2.h>
#include<stdio.h>

void main (void)
{
 SOCKET handle,newhandle;
 struct sockaddr_in serv_addr,client_addr;
 u_long hr,hr1;
 int clientlen;
 char buff[55000]={0};
 char buff1[20000]={0};
 WORD wVersionRequested;
 WSADATA wsaData;
 int err;
 int non_block=1;
  wVersionRequested = MAKEWORD( 2, 0 );
  err = WSAStartup( wVersionRequested, &wsaData );
 handle=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
 hr=ioctlsocket(handle, FIONBIO,(u_long*) &non_block);
 serv_addr.sin_family=PF_INET;
 serv_addr.sin_port=htons(6000);
    serv_addr.sin_addr.s_addr=inet_addr("10.1.51.68");
 hr=bind(handle,( struct sockaddr*)&serv_addr,sizeof(serv_addr));
 if(hr==0)
 {
  printf("binding succesful");
 }

 listen(handle,5);
 clientlen=sizeof(client_addr);
 printf("server waiting for client to connect............");
 while(1)
 {
  newhandle=accept(handle,( struct sockaddr*)&client_addr,&clientlen);
  hr=WSAGetLastError();
  if(newhandle!= INVALID_SOCKET )
  break;
 }
 hr=1;
 while(true)
 {
  hr=recv(newhandle,buff1,200,0 );
  strcat(buff,buff1);
  if(hr==0)
   break;
 }
 printf(buff);

// if (hr>0)printf("bytes succesfully recieved");
 closesocket(handle);
 WSACleanup();

}
 Bye
Shakthimani

Ramonator wrote:

> This may sound way lame, but can anybody take me step by step sort of on
> how
> to create and bind a socket and then send data and receive it?
> I would greatly appreciate any help.
>
> thanks
>
> --------------------------------------------------------------------------
> The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription info and archives,
> see http://peach.ease.lsoft.com/archives/msvc.html .  For LISTSERV sales
> information, see http://www.lsoft.com or write to SALES@LSOFT.COM.



--------------F0525E5361B7846E17B73851
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Shakthimani .L
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Shakthimani .L
n:              .L;Shakthimani
org:            Larsen&Toubro Information Technologies Ltd
adr:            SakiVihar Road,Powai;;;Mumbai;Maharastra;;India
email;internet: shakthi@usa.ltindia.com
title:          Software Engineer
tel;work:       8581401/1411
tel;home:       7663088
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------F0525E5361B7846E17B73851--

------------------------------

Date:    Fri, 22 May 1998 22:47:07 -0500
From:    Ramonator <ramon@CUTEANDCUDDLY.COM>
Subject: DOH!

I don't have Winsock2, is the code pretty much the same for Winsock
1.1???

------------------------------

End of MSVC Digest - 21 May 1998 to 22 May 1998 (#1998-137)
***********************************************************
--
        There are these few times I feel lonely for you.
        But I know this shade of blue will soon pass through!
        I must be strong without you by my side!
        I can see forever you are my light.

※ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店