programming with sockets on Xilinx Virtex2Pro

Does anyone know why Xilinx' socket function library, xilsock.h, does not contain a xilsock_connect() function?

Also, do you know how xilsock_accept() works? It appears to be non-blocking by default. Is this the case?

At this moment, the client I have running on a windows PC is getting a WSACONNREFUSED error when it attempts to connect() to a socket on the V2Pro. The server on the V2Pro is spinning in a loop that executes xilsock_accept().

I've tried various port numbers and the connect error is the same. If you have any insight from just this info, please let me know. Also if you have the time and would like to see the code, I'd be happy to email it to you. Or I can probably post it here later.

Thanks, Jim

Reply to
Jimbo
Loading thread data ...

I haven't played around with the socket library since they came out with EDK 6.1, but I seem to recall that at the time, only one side (server side) had been implemented, which would explain why there is only a xilsock_accept, and no xilsock_connect. Additionally, I remember many a discussion (you might want to do an archive search) on this NG about the flakiness of the socket library (I was hoping it had been improved with

6.1, which version are you using?). For what it's worth, I personally never got it to work reliably. However, from what I can tell of the code I have, xilsock_accept was blocking. If you want to compare your non-working code to my non-working code (I seem to recall that I could at least accept connections, however unreliably), I'd be happy to make it available, although I heavily based it on the (MicroBlaqze) web server example I got from Xilinx, which I assume you've already looked at.

Has anyone out there ever gotten the xilsock library to work reliably? I don't want to waste any more time on it unless there's a good chance of success at the end...

--
Pierre-Olivier

-- to email me directly, remove all _N0SP4M_ from my address --
 Click to see the full signature
Reply to
PO Laprise

XilNet was developed to fit into smaller devices and hence we have restrictions. Currently, we have only server support functionalities in XilNet. Since xilsock_connect is more of a client functionality, this is not supported. As of xilsock_accept(), the way it works is by polling the ethernet driver for packets. If a request for a new connection is received, then a reply is sent to the client (TCP handshaking happens) and a flag XILSOCK_NEW_CONN is returned to the application to indicate that a new connection is received. The flags returned to the application from XilNet is documented in xilsock.h.

If you want something that is not supported in XilNet, there is an open source project called lwip that has a full standalone TCP/IP stack for processors from Xilinx (PowerPC and MicroBlaze). Finally, there are various operating systems that support these processors and provide TCP/IP implementations - see

formatting link
for more info on OS support.

-- Mohan

Reply to
mohan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.