I am trying to establish a TCP socket between my linux server and my client 
running on my laptop. The TCP server code I am running is,

from socket import *

    HOST = ''
    PORT = 1999
    serversocket = socket(AF_INET,SOCK_STREAM)
    serversocket.bind((HOST,PORT))
    serversocket.listen(5)
    while True:
        (clientsocket, address) = serversocket.accept()
        print ("Got client request from",address)
        clientsocket.send("Thank You for connecting")
        clientsocket.close()

The TCP client code I am running is :

from socket import *

clientsocket = socket(AF_INET,SOCK_STREAM)

clientsocket.connect(("my-server-ip-address",1999))

recv = clientsocket.recv(1024)
print(recv)

The problem I am facing is that I am not able to communicate with the 
server from my client. WHen I run both the TCP client and server code on my 
linux server, the communication works. So, I have narrowed down this issue 
to lack of open TCP ports on my server. I am using windows 8 on my laptop. 
I did an nmap from my laptop to my server and the list of open ports 
available were, 80/tcp, 443/tcp,22/tcp. So, can anyone suggest on how to 
add a port to the list of open ports. For example, in this case I need to 
add 1999 to the list of open ports.

Server version: Linux hostname 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 
11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

-- 
-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or 
http://cdn.fsdev.net/List-Rules.pdf)

--- 
You received this message because you are subscribed to the Google Groups 
"Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to