Use sockets to send data from unity

I’m developing an unity project that needs to open a socket to the http server, and send some data to it.

I already have code in eclipse that does that, so can you please instruct me how to do this in unity. I suppose I need to call different functions to create socket and send data trough it.

Here’s my code simple code in eclipse:






It sends “A” to the server, so I would like to do the same in unity.

I would appreciate any help you can provide.

Thanks in advance.

Use System.Net.Sockets.