You certainly can do it in a number of ways, because sockets are sockets, very similar on different platforms, but one approach would be the most straightforward: writing the same code on both platforms using C#. To use C# and other .NET languages on Android, you need an alternative CLR implementation, the one which can work on Android. Such thing does exist:
http://en.wikipedia.org/wiki/Mono_%28software%29[
^].
Unfortunately, Mono for Android (MonoDroid) is commercial. There is the open-source equivalent based on ported Mono build:
https://github.com/koush/androidmono[
^].
—SA