Jump to content
jopil

TM4C1294XL How to identify connected tcp_clients on launchpad

Recommended Posts

Hello all.

I have coded a simple TCP Ethernet Server for the launchpad, that works perfect when I test it with any piece of remote client software like PuTTy, Hyperterminal, or self crafted TCP clients. However, when two or more clients are connected seems that there is no way, to discriminate who-is-who, since there in no obvious way to extract IP & Port of the connected clients. This is a necessity when one wants to handle different connected clients differently. Any help on this would be greatly appreciated. Thank you. John

 

Share this post


Link to post
Share on other sites

I've just started looking at a web server project myself. I can't help with this exact problem (yet).

 

However, are you sure this is the right approach? Web stuff works best if you don't try to retain knowledge of clients. A cookie handed to the content on first request and detected afterwards might be a better way. Something added to the URL (e.g. query) is another way if you're not worried about one client easily impersonating another.

Share this post


Link to post
Share on other sites

Fred, thankzzzz for your insightful reply, but as a wise American friend of mine once told me,  web came long after sockets were born. So, based on my experience, I only trust bare-bone TCP sockets and sessions as the ultimate mechanism for robust internet info transfer. I can't imagine of any serious reason that ENERGIA's folks left this client's logistic info out of their scope other that they simply overlooked it. The simplest C, C++, Java & C# code manifestations of client-server logistics, supply those info by default. I can only guess that I haven't got something correctly regarding ENERGIA's/TM4C1294XL Ethernet libs implementation. But in case you have some more info on this, me and many more on this forum would be indebted to you. Again, thank you very much. John 

Share this post


Link to post
Share on other sites

Yes, I did assume web. I still think that you're better to let the clients identify themselves with a token rather than to track them. Better practice in an environment where a clients may disappear at any point, share a proxy, etc. Obviously, I don't know exactly what you're trying to do so you may have specific requirements.

 

I also hadn't noticed you're using Energia. I use the "new posts" link and hasn't spotted the category. I don't use Energia so won't be able to help with anything specific. I'm going through the TI-RTOS examples at the moment.

Share this post


Link to post
Share on other sites

O.K. Fred. Thankzzz anyway. I need to be able to discriminate between different connected clients because I direct their calls to a serial port of the launchpad connected to a data logger. Data Logger is meant to send different info to each connected client and I catch this by having the datalogger's firmware  to stamp the data packets. So, in my launchpad code I know the destination of the received data packet, but yet, I don't know how to direct them to the proper client since I don't have the IP/Port socket info. That is why I need to track them for each connected client.

Share this post


Link to post
Share on other sites

Thank you ENERGIA. I'll try this and I'll let you know. But in the case that both launchpad and connected clients are on the same private or public subnet, without intervening routers and NAT, then how can I distinguish physical client_m from physical client_n, for keeping data logistics in order, if I don't know the IPs? Thank you. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...