EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Proposed change to asyn drvAsynIPPort for UDP sockets
From: Mark Rivers <[email protected]>
To: EPICS Tech Talk <[email protected]>, EPICS Core-Talk <[email protected]>
Date: Tue, 8 Dec 2015 18:35:54 +0000

Folks,

 

I have found a problem with the handling of UDP sockets in drvAsynIPPort.  The problem arises when a broadcast socket is created using the IP protocol string “UDP*” in the call to drvAsynIPPortConfigure().  Calls to asynOctet->write() are OK, broadcast messages get sent correctly.  However, if a client attempts to reply to such a broadcast (using the ephemeral source port number that was sent in the broadcast message) then that reply is rejected by the host that sent the broadcast.

 

The problem is that the current version of drvAsynIPPort always calls connect() on all sockets, including UDP sockets.  It then calls send() and recv() to write and read from the socket respectively.  This does not work correctly in the case of UDP broadcast sockets. 

 

I have created a new issue for the problem on github:

https://github.com/epics-modules/asyn/issues/11

 

The problem is fixed by doing the following for broadcast UDP sockets:

- Don't call connect()

- Call sendto() rather than send()

- Call recvfrom() rather than recv()

 

Eric Norum and I cannot think of a reason not to make the above changes for all UDP sockets, not just broadcast sockets.  I have made a new udp_fixes branch on github that implements the above changes for all drvAsynIPPort UDP ports.

 

https://github.com/epics-modules/asyn/tree/udp_fixes

 

I have tagged the current version of that branch as the R4-28beta1 release.

 

I would like to encourage comments and testing of these changes before I release asyn R4-28.  If you currently use UDP sockets with asyn please try to test by either checking out the udp_fixes branch or downloading the tar or zip file for R4-28beta1 release.

 

Thanks,

Mark

 


Replies:
RE: Proposed change to asyn drvAsynIPPort for UDP sockets Mark Rivers
Re: Proposed change to asyn drvAsynIPPort for UDP sockets Henrique Almeida

Navigate by Date:
Prev: PCIe encoder data acquisition board Vasquez Stanescu, Jesus A
Next: RE: Proposed change to asyn drvAsynIPPort for UDP sockets Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: PCIe encoder data acquisition board Vasquez Stanescu, Jesus A
Next: RE: Proposed change to asyn drvAsynIPPort for UDP sockets Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·