How do I get client ip address in TCP mode?
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: How do I get client ip address in TCP mode?
by Coccoliso ·
Hello BitBanger46,
UDP is connectionless so you can retrieve the address of the incoming stream from first bytes of the same.
With TCP in order to communicate you have to have established a connection.
The following is an example of TCP server do in basic metalanguage that go in the continuous loop of your main program …
When the connection is established in fact you do not need anything else unless you intend to open a second socket to those who contacted you earlier in the socket. However you can know the remote address via the 4 registers ( socket offset registers ) Sn_DIPR0…Sn_DIPR3 for the IP address and via Sn_DHAR0 … Sn_DHAR5 its MAC address.
In the C++ sources as provided in W5500 support site are routines that do this.
RE: How do I get client ip address in TCP mode?
by BitBanger46 ·
Thank you for the help!! I am somewhat embarrassed because I didn’t pay closer attention to the W5500 data sheet while I was coding the register access library for my application. I did test my code in a TCP/IP environment and it indeed works properly without having to load the DIPR and DPORT registers with the address of the client.
RE: How do I get client ip address in TCP mode?
by dhara5 ·
hello,
As you said you have successfully established TCP connection, I am doing the same. I am using W5500 as TCP server. And I am using hyperterinal as my TCP client.
But when my socket goes in LISTEN mode, it does not get any reply and even from the hyper terminal it is not able to connect. Means either the hyperterminal is not sending sync packet or my W5500 is not accepting it.
In hyperterminal it is showing UNABLE TO CONNECT.
Can you please give any solution for this ?