🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1161

How to "listen" to sockets ?

#1161
From: Rig
Date: Fri, 19 Mar 2004 18:01
14 lines
1625 bytes
Hi Guys,

Just a quick one ... I am having trouble listening to sockets in Java.

I am writing a simple chat client, and I am using JBuilder 9. I am fine
using events etc, but I am having trouble "listening" to the incoming
connection.

How would I do this? Is a timer the best option that checks, say, every 1
second for new data on the port - or is there a more efficient way?

Many thanks for your help.

Andrew.
Technical Details
Message-ID: <405b356e$0$6551$cc9e4d1f@news-text.dial.pipex.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!proxad.net!fr.ip.ndsoftware.net!newsfeed.wirehub.nl!news2.euro.net!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e05b3130d9981c65,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-03-19 10:01:19 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!proxad.net!fr.ip.ndsoftware.net!newsfeed.wirehub.nl!news2.euro.net!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!not-for-mail
From: "Rig" <rig@NOSPAMcallnetuk.com>
Newsgroups: borland.public.jbuilder.java.swing
Subject: How to "listen" to sockets ?
Date: Fri, 19 Mar 2004 18:01:47 -0000
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
Lines: 16
Message-ID: <405b356e$0$6551$cc9e4d1f@news-text.dial.pipex.com>
NNTP-Posting-Date: 19 Mar 2004 18:01:18 GMT
NNTP-Posting-Host: 81-178-241-120.dsl.pipex.com
X-Trace: 1079719278 news-text.dial.pipex.com 6551 81.178.241.120:10160
X-Complaints-To: abuse@uk.uu.net