Sending and receiving a byte array to an IP address
-
Good morning everyone. I'm developing an application that listens to incoming TCP/IP socket connections from client applications. the client connects to my server and sends an array of bytes. My application receives it, does some calculation on the bytes and resends the modified byte array back to the client. I was pretty new to socket connections, so i thoroughly read the article "Asynchronous socket communication" here on Code Project. I managed to put up this application and it seems to work (i did not have to develop the client, that is made by another programmer). My problem is that i was recently asked to make this service accessible also on the Internet through a website. I should put up a simple page with a textbox and a button: the user writes a HEX string in the textbox, pushes the button and he's prompted with the result. As a complete newbie to ASP, i first tried the desperate attempt to do the old "cut&paste": after a small adjustment, the very same code i used for a c# test application (that i used to connect to my server app) compiled under ASP. As i load the page, i can see my server application recognizes and accepts the connection; sometimes i even manage to send the byte array; but nothing is received back. I know it was too much to expect this rough approach to work flawlessly: so i think it's better to write it from scratch. Though, after some unproductive googling, my poor (read: none) knowledge of ASP led me to ask for help here. I know it may be laughably simple for you experts, but i really just need to do this: - send a byte array to a specified IP address on a specified port; - keep listening for a similar byte array - display the received code under the form of a HEX string. Please note that due to the heavy calculations needed, the server can take up to two-three minutes before sending the answer. If anyone can help me, or at least can point me out some articles which can enlighten me, i would be very grateful. Thanks in advance, all of you.
~~~ From Milano to The Hague, easy as it goes ~~~