🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #563

Re: Sockets and Client/Server applications

#563
From: Kevin Dean
Date: Mon, 09 Jun 2003 15:34
44 lines
3133 bytes
The implementations are hidden so that the JVM providers (and perhaps
third-party library providers) can implement the sockets in the best manner
possible for the underlying environment.  Other categories of API in which
this occurs are file I/O, screen management, and event (keyboard and mouse)
management.

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.

-- 
Check out our latest white papers at
http://www.datadevelopment.com/papers/index.html

BladeNET Scores With Borland Enterprise Tools
Team Development with JBuilder and Borland Enterprise Server

Dolphin Data Development Ltd.
http://www.datadevelopment.com/

"Alan Shiers" <ashiers@hfx.eastlink.ca> wrote in message
news:3EE34D95.E0767B34@hfx.eastlink.ca...
> Hi there,
>
> It maybe that Sun has hidden the implementation from us when they made
> the java.io.Socket and java.io.ServerSocket classes, but out of
> curiosity, I was wondering how a socket is able to distinguish incoming
> data as belonging to a specific ongoing process?
>
> In other words,  in a client/server application, it is possible that you
> could have two or more clients logged on to the server application
> simultaneously. Naturally, it is possible to assume that, for each
> client logged on, each would be sending and receiving different pieces
> of data all at the same time.  This being the case, is the Socket or
> ServerSocket class able to distinguish the fact that certain incoming
> data is intended as a request from Client2 and not from Client3? After
> all, they all obtain their InputStreams and OutputStreams in the same
> manner by calling the respective methods of the Socket or ServerSocket
> classes [getInputStream() or getOutputStream()].
>
> Alan
Technical Details
Message-ID: <3ee4a9df$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3EE34D95.E0767B34@hfx.eastlink.ca>

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 08:39:32 PST
From: "Kevin Dean" <NkOdSePaAnM@datadevelopment.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3EE34D95.E0767B34@hfx.eastlink.ca>
Subject: Re: Sockets and Client/Server applications
Date: Mon, 9 Jun 2003 11:34:32 -0400
Lines: 46
Organization: Dolphin Data Development Ltd.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.57.150.243
Message-ID: <3ee4a9df$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1055173087 24.57.150.243 (9 Jun 2003 08:38:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail