Thanks, I'll download a copyXorA wrote:Get yourself a copy of wireshark to install on the PC, this will show you everything that is going on network wise. Its essential tool for debugging network issues.
for the sockaddr structure I am using something like (working from memory here)tofro wrote:when you use recvfrom (), you need to actually allocate some space for the call to store the address of the sender. It should be empty (it's about to be overwritten by the recvfrom() call anyhow), and have enough space for an IPv4 adress, that is, you must allocate memory for a struct sockaddr_in structure, even if the prototype only asks for a struct sockaddr. If there's not enough space, recvfrom() will complain.
Code: Select all
sockaddr dc.w 2 ;family AF_INET
dc.w 1002 ;port
dc.b 172,16,0,15 ;IP address
dc.l 0
dc.l 0
Does this look about right?
This is one of my vague areas, I'm not entirely sure I am opening the channel correctly. When you give the "host:port" is it always "the other computers IP address:other computers port", or does it have different meanings between TCP_ and UDP_?tofro wrote:Bind the socket to a port (should be otherwise un-used and above at least 1024, better above 5000)
Note with some of the open() keys in combination with a properly formed device name, you can actually do both of the above steps in one
If it's any help to you this is the documentation I am using for IP_OPEN
Code: Select all
IP_OPEN TRAP#2 D0=1
Opens a channel.
Input
D1 = Job ID
D3 = code where bit:
0 = creates a socket of requested type/protocol.
1 = TCP and UDP. host and port must be specified. Opens a
connection TCP, or sets peer address for UDP sockets.
Returns without error if connection can't be completed within
1-2/50s, internally the connection buildup continues. Every i/o
operation will be blocked until the connection succeeds or fails.
2 = bind TCP or UDP socket to an address. Such sockets
can be used for accepting incoming connections.
Channel ID = SCK only. accpet connection for socket
specified by channel_id. Returns error if can't complete
immediately.
A0 = Address of channel name
Output
D0 = result (0 if OK)
D1 = Job ID
A0 = channel ID
Martin