Article View: borland.public.cppbuilder.internet.socket
Article #4025Re: Socket problem setting port and connecting.
From: Bob Gonder
Date: Wed, 27 Apr 2005 14:35
Date: Wed, 27 Apr 2005 14:35
31 lines
2184 bytes
2184 bytes
Egi2kaZz wrote:
>void __fastcall TForm1::FormCreate(TObject *Sender)
>{
>ClientSocket1->Host = "192.168.0.1";
>ClientSocket1->Address = "192.168.0.22";
>ClientSocket1->Active = true;
>}
What happend to Port?
You don't show port in your code, but you mentioned 1024 which could
be a bit small.
See this link for a (large) list of registered ports.
http://www.iana.org/assignments/port-numbers
Pick something that is "unassigned" or that you know won't be a
problem (like PlayStation2)
> TFileStream *file = new TFileStream("film.avi",fmCreate);
> try {
> ReadStream(Socket, file);
> }
> __finally {
> delete file;
> }
Just wondering if "delete file" closes the file first.
The docs only mention that it releases the handle.
Perhaps
FileClose( file->Handle);
delete file;
would fix a part of the problem? ( 0 file size )
Technical Details
Message-ID:
<277v611esvpat0horu0mqf5ir1hvp1bbep@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42638bd3$1@newsgroups.borland.com> <4263a52c@newsgroups.borland.com> <426abd97@newsgroups.borland.com> <426bf467$1@newsgroups.borland.com> <426e472d$1@newsgroups.borland.com> <426e737e$1@newsgroups.borland.com> <426e9298@newsgroups.borland.com> <426eaf63@newsgroups.borland.com> <426f51a5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,87ef1514521c3f8d X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Socket problem setting port and connecting. Date: Wed, 27 Apr 2005 07:35:19 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <277v611esvpat0horu0mqf5ir1hvp1bbep@4ax.com> References: <42638bd3$1@newsgroups.borland.com> <4263a52c@newsgroups.borland.com> <426abd97@newsgroups.borland.com> <426bf467$1@newsgroups.borland.com> <426e472d$1@newsgroups.borland.com> <426e737e$1@newsgroups.borland.com> <426e9298@newsgroups.borland.com> <426eaf63@newsgroups.borland.com> <426f51a5@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.41.182 X-Trace: newsgroups.borland.com 1114612512 67.77.41.182 (27 Apr 2005 07:35:12 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail