Article View: borland.public.jbuilder.java.api
Article #564Re: Sockets and Client/Server applications
From: Alan Shiers
Date: Mon, 09 Jun 2003 16:11
Date: Mon, 09 Jun 2003 16:11
28 lines
2119 bytes
2119 bytes
Kevin Dean wrote: > > As for distinguishing between clients, the TCP/IP protocol takes care of > that. It ensures that the incoming data is routed to the correct socket > based on the source IP address and port; what you see in Java is that all > requests from a given client will come through the same input stream. Java > doesn't need to do anything other than map the underlying OS API into the > Java API. Ok, so what if you have two separate sockets set to the same Port Number? Let's also say, that you have different InputStream and OutputStream type classes connected to each Socket. For instance, you're using DataInputStream and DataOutputStream on Socket1 and BufferedInputStream and BufferedOutputStream on Socket2. Since we're trying to send/receive different types of data through these sockets and they both are set to the same Port Number, is there any chance that the incoming data can get mixed up, thereby causing Exceptions? If there is this possibility, then perhaps it's better to have each socket set at a different Port Number to ensure data transfer integrity? Regards, Alan
Technical Details
Message-ID:
<3EE4B19A.D1A9BF4@hfx.eastlink.ca>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3EE34D95.E0767B34@hfx.eastlink.ca> <3ee4a9df$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,21183e92a0cd9ddc X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-06-09 09:17:43 PST Message-ID: <3EE4B19A.D1A9BF4@hfx.eastlink.ca> Date: Mon, 09 Jun 2003 13:11:06 -0300 From: Alan Shiers <ashiers@hfx.eastlink.ca> X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: Sockets and Client/Server applications References: <3EE34D95.E0767B34@hfx.eastlink.ca> <3ee4a9df$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.222.101.2 X-Trace: newsgroups.borland.com 1055175140 24.222.101.2 (9 Jun 2003 09:12:20 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail