Sponsored Content
Full Discussion: Socket Problem
Top Forums Programming Socket Problem Post 48892 by Agent007 on Sunday 21st of March 2004 02:55:26 PM
Old 03-21-2004
Socket Problem

Hi all,
I have developed server/client application (using C) and tested it on the same machine .. but when I deploy them on different machines I get connection timeout.

Well .. server machine and client machine exists on different network segments, so there is a linux firewall box to route traffic (all ports are open on it)

so my question is there anyway that client program can communicate with my server program via the firewall .. is there any function in C for this kind of setup

(I searched alot but didn't find anything useful .. so If it is not possible .. how come there exists so many server/client application that can communicate via firewalls)
 

10 More Discussions You Might Find Interesting

1. HP-UX

Problem in HP-Unix while writing into socket

Our system is having a server and multiple clients. We are monitoring the client FDs using select() system call in HP-UX. After establishing connection-using socket with the remote client, before start sending the data we are checking the status of socket using select( ) call. For first 16... (0 Replies)
Discussion started by: AshokG
0 Replies

2. Programming

Problem Connecting to Socket

Can anyone help? I'm trying to write a program which will write to a socket. I can get the server to run, but always get an error when I try to connect. It gives me an error at the "connect" command. It's probably a simple error, but I can't seem to find it. #include <sys/socket.h>... (6 Replies)
Discussion started by: Stevhp
6 Replies

3. UNIX for Advanced & Expert Users

problem with socket reading

I am not able to receive the message on socket in the current process when its waiting for its child to exit. code looks something like below //in one thread of the current process //thread 1 =============================================== int numBytes = read(sockid,buf,SIZE); //Now the... (2 Replies)
Discussion started by: swap007
2 Replies

4. Programming

and again, socket() related problem...

Dear All, I've searched many topics and googled many web-pages, but still I didn't found solution to this problem. I want to set timeout for connect(). The thing is, that my code works only on BSD, on Linux (tested on SuSE box) it freezes at connect() call :( bool SomeFunc(std::string... (1 Reply)
Discussion started by: sggkxv
1 Replies

5. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

6. Programming

Problem with socket connection

I have a client /server file operation program.It works properly when i run the client and server program in the same system.but when i try to run the client in one system and server in another system i am getting an error in the cleint machine as "ERROR:Connection refused". Plz help me in this ... (1 Reply)
Discussion started by: vigneshinbox
1 Replies

7. Programming

Problem with Socket program..

I wrote a program which will send a message to multiple clients(i.e, broadcasting) that are connected to a server.Once when the client receives a message from the server ,the client should read a file in the server and display it in the client.The client which responds (i.e, client wants all the... (3 Replies)
Discussion started by: vigneshinbox
3 Replies

8. Programming

Socket++ library problem.

Hi, My name is Daniel and I'm spanish, so I'm sorry if you can't undertand something becouse of my low-level english. Something stranger is happening to me with socket++ library and I don't know how to work on it. I has a library called commands.so and the sslclient is and object of that... (4 Replies)
Discussion started by: lock.cda
4 Replies

9. Post Here to Contact Site Administrators and Moderators

socket programing-problem with server

hi, i am new to socket programming.i have a problem in server.requirement is it should continuosly read the requests from client(sends requests continuously) and after certain delay(i kept der sleep) should send response. for this i used msgqueues so that after reading it is sending into... (1 Reply)
Discussion started by: chandinisree
1 Replies

10. IP Networking

Execution Problem with socket

Hi My socket program is to communicate between the two systems connected with lan. Always i am getting an error saying bind value is -1 or not connected. ..If i run both the server and client programs in the same machine in two diff terminals they are working but they are not working between two... (3 Replies)
Discussion started by: Gurvareddy
3 Replies
ost::DCCPSocket(3)					     Library Functions Manual						ost::DCCPSocket(3)

NAME
ost::DCCPSocket - DCCP sockets are used for stream based connected sessions between two sockets. SYNOPSIS
#include <socket.h> Inherits ost::Socket. Public Member Functions virtual bool onAccept (const IPV4Host &ia, tpport_t port) A method to call in a derived DCCPSocket class that is acting as a server when a connection request is being accepted. virtual bool onAccept (const IPV6Host &ia, tpport_t port) virtual IPV4Host getIPV4Sender (tpport_t *port=NULL) const virtual IPV6Host getIPV6Sender (tpport_t *port=NULL) const DCCPSocket (const IPV4Address &bind, tpport_t port, unsigned backlog=5) A DCCP 'server' is created as a DCCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests. DCCPSocket (const IPV6Address &bind, tpport_t port, unsigned backlog=5) DCCPSocket (const char *name, Family family=IPV4, unsigned backlog=5) Create a named dccp socket by service and/or interface id. DCCPSocket (Family family=IPV4) Create an unconnected ephemeral DCCP client socket. DCCPSocket (DCCPSocket &server, timeout_t timeout=0) Create a server session by accepting a DCCP Socket. void reject (void) Used to reject the next incoming connection request. void disconnect (void) Disconnect active dccp connection (client use). bool setCCID (uint8 ccid) Set CCID DCCP. int getTxCCID () Get TX CCID DCCP. int getRxCCID () Get RX CCID DCCP. size_t available () Return number of bytes to be read. void connect (const IPV4Host &host, tpport_t port, timeout_t timeout=0) Create a DCCP client connection to a DCCP socket (on a remote machine). void connect (const IPV6Host &host, tpport_t port, timeout_t timeout=0) void connect (const char *name) Connect to a named client. bool isPendingConnection (timeout_t timeout=TIMEOUT_INF) Used to wait for pending connection requests. virtual ~DCCPSocket () Use base socket handler for ending this socket. Additional Inherited Members Detailed Description DCCP sockets are used for stream based connected sessions between two sockets. Both error recovery and flow control operate transparently for a DCCP socket connection. The DCCP socket base class is used both for client connections and to bind a DCCP 'server' for accepting DCCP streams. An implicit and unique DCCPSocket object exists in Common C++ to represent a bound DCCP socket acting as a 'server' for receiving connection requests. This class is not part of DCCPStream because such objects normally perform no physical I/O (read or write operations) other than to specify a listen backlog queue and perform 'accept' operations for pending connections. The Common C++ DCCPSocket offers a Peek method to examine where the next pending connection is coming from, and a Reject method to flush the next request from the queue without having to create a session. The DCCPSocket also supports a 'OnAccept' method which can be called when a DCCPStream related object is created from a DCCPSocket. By creating a DCCPStream from a DCCPSocket, an accept operation automatically occurs, and the DCCPSocket can then still reject the client connection through the return status of it's OnAccept method. Author: Leandro Sales leandroal@gmail.com Heverton Stuart hevertonsns@gmail.com bound server for DCCP streams and sessions. Constructor &; Destructor Documentation ost::DCCPSocket::DCCPSocket (const IPV4Address &bind, tpport_tport, unsignedbacklog = 5) A DCCP 'server' is created as a DCCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests. If the server cannot be created, an exception is thrown. Parameters: bind local ip address or interface to use. port number to bind socket under. backlog size of connection request queue. ost::DCCPSocket::DCCPSocket (const IPV6Address &bind, tpport_tport, unsignedbacklog = 5) ost::DCCPSocket::DCCPSocket (const char *name, Familyfamily = IPV4, unsignedbacklog = 5) Create a named dccp socket by service and/or interface id. For IPV4 we use [host:]svc or [host/]svc for the string. If we have getaddrinfo, we use that to obtain the addr to bind for. Parameters: name of host interface and service port to bind. backlog size of connection request queue. ost::DCCPSocket::DCCPSocket (Familyfamily = IPV4) Create an unconnected ephemeral DCCP client socket. ost::DCCPSocket::DCCPSocket (DCCPSocket &server, timeout_ttimeout = 0) Create a server session by accepting a DCCP Socket. virtual ost::DCCPSocket::~DCCPSocket () [virtual] Use base socket handler for ending this socket. Member Function Documentation size_t ost::DCCPSocket::available () Return number of bytes to be read. void ost::DCCPSocket::connect (const IPV4Host &host, tpport_tport, timeout_ttimeout = 0) Create a DCCP client connection to a DCCP socket (on a remote machine). Parameters: host address of remote DCCP server. port number to connect. void ost::DCCPSocket::connect (const IPV6Host &host, tpport_tport, timeout_ttimeout = 0) void ost::DCCPSocket::connect (const char *name) Connect to a named client. void ost::DCCPSocket::disconnect (void) Disconnect active dccp connection (client use). virtual IPV4Host ost::DCCPSocket::getIPV4Sender (tpport_t *port = NULL) const [virtual] Reimplemented from ost::Socket. virtual IPV6Host ost::DCCPSocket::getIPV6Sender (tpport_t *port = NULL) const [virtual] Reimplemented from ost::Socket. int ost::DCCPSocket::getRxCCID () Get RX CCID DCCP. int ost::DCCPSocket::getTxCCID () Get TX CCID DCCP. bool ost::DCCPSocket::isPendingConnection (timeout_ttimeout = TIMEOUT_INF) [inline] Used to wait for pending connection requests. Returns: true if data packets available. Parameters: timeout in milliseconds. TIMEOUT_INF if not specified. References ost::Socket::isPending(), and ost::Socket::pendingInput. virtual bool ost::DCCPSocket::onAccept (const IPV4Host &ia, tpport_tport) [virtual] A method to call in a derived DCCPSocket class that is acting as a server when a connection request is being accepted. The server can implement protocol specific rules to exclude the remote socket from being accepted by returning false. The Peek method can also be used for this purpose. Returns: true if client should be accepted. Parameters: ia internet host address of the client. port number of the client. virtual bool ost::DCCPSocket::onAccept (const IPV6Host &ia, tpport_tport) [virtual] void ost::DCCPSocket::reject (void) Used to reject the next incoming connection request. bool ost::DCCPSocket::setCCID (uint8ccid) Set CCID DCCP. Member Data Documentation struct sockaddr_in ost::DCCPSocket::ipv4 struct sockaddr_in6 ost::DCCPSocket::ipv6 Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::DCCPSocket(3)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy