How can i make this socket connection works as is on Arduino

You don't get a standard sockets API with the ethernet shield. Try one of the examples that come with the library instead.