Lord, Chris wrote:
> I want some client software I am writing to be able to determine if my server 
> software is up and running and if so the IP address of the server machine to 
> save the user having to set up IP addresses and so on.  Having looked at a 
> demo for doing exactly what I need, I set up  a UDP socket server on the 
> server software in listen mode and a TWSocket in listen mode on the client.  
> I set both of them to UDP and to port 9183.  On the client, I then create a 
> temporary TWSocket component and broadcast to 255.255.255.255 a short message 
> as the demo does.  The message is about 20 bytes long.

255.255.255.255 is not a good idea I think.
You should use the broadcast address of your subnet.. 10.0.0.255, 
192.168.255.255 or whatever, depending on your subnet mask.

> Now, the problem appears to be that it seems a little hit and miss.  
> Sometimes the server sees the client and responds correctly and sometimes it 
> doesn't.  I wondered if the packets were being received OK (as UDP can split 
> packets and so on) 

a 20 bytes long packet never get splitted, it's far beyond MTU.

so I downloaded a packet sniffer and ran it both on the client and server 
machines.  I am certain from this that the client machine is sending out the 
broadcast.  I can also see that the server has received the broadcast 
message and it is complete in 1 packet.  However, the DataAvailable function 
doesn't seem to get called and I am now at a loss as to why.  Have I missed 
something obvious?

What's the demo you're referring to?
Try to make UDP server listen on 0.0.0.0 port 9183.
UDP client sends the broadcast packet to broadcast address (are you using 
.SendTo?)

Regards
-- 
Marcello Vezzelli
CTO
Software Development Department
E-Works s.r.l.
tel. +39 059 2929081
fax +39 059 2925035
Direzionale 70 - Via Giardini 456/c
41100 Modena - Italy

---------------------------------------------------------------------
La presente comunicazione, che potrebbe contenere informazioni riservate e/o 
protette da segreto professionale, è indirizzata esclusivamente ai 
destinatari della medesima qui indicati. Le opinioni, le conclusioni e le 
altre informazioni qui contenute, che non siano relative alla nostra 
attività caratteristica, devono essere considerate come non inviate né 
avvalorate da noi. Tutti i pareri e le informazioni qui contenuti sono 
soggetti ai termini ed alle condizioni previsti dagli accordi che regolano 
il nostro rapporto con il cliente. Nel caso in cui abbiate ricevuto per 
errore la presente comunicazione, vogliate cortesemente darcene immediata 
notizia, rispondendo a questo stesso indirizzo di e-mail, e poi procedere 
alla cancellazione di questo messaggio dal Vostro sistema. E' strettamente 
proibito e potrebbe essere fonte di violazione di legge qualsiasi uso, 
comunicazione, copia o diffusione dei contenuti di questa comunicazione da 
parte di chi la abbia ricevuta per errore o in violazione degli scopi della 
presente.
---------------------------------------------------------------------
This communication, that may contain confidential and/or legally privileged 
information, is intended solely for the use of the intended addressees. 
Opinions, conclusions and other information contained in this message, that 
do not relate to the official business of this firm, shall be considered as 
not given or endorsed by it. Every opinion or advice contained in this 
communication is subject to the terms and conditions provided by the 
agreement governing the engagement with such a client. If you have received 
this communication in error, please notify us immediately by responding to 
this email and then delete it from your system. Any use, disclosure, copying 
or distribution of the contents of this communication by a not-intended 
recipient or in violation of the purposes of this communication is strictly 
prohibited and may be unlawful.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to