Opening a TCPIP Port with UNIX C


 
Thread Tools Search this Thread
Top Forums Programming Opening a TCPIP Port with UNIX C
# 1  
Old 04-13-2007
Opening a TCPIP Port with UNIX C

i am new to UNIX and C (primarilly a JDE and AS400/RPG developer). However,
I need to find a way to send data to and from a web service from within a UNIX C program.

What i would like to be able to do is to receive in a block of XML (from a non C application), wrap it, and then open a TCPIP port on the server to communicate with the web service. I would then send the XML block to the web service and then recieve a message back to confirm the data was received.

I have 2 questions:

1. is there a way to open a TCPIP port in UNIX C? if so could you point me in the right direction of how to do this?

2. has anyone done anything like the process I describe above before?

Many thanks for your help on this.
# 2  
Old 04-13-2007
This tutorial might be just what you need. Covers your first question. As for your second question, yes I imagine that quite a few of the members have done some sort of network programming before.
# 3  
Old 04-13-2007
Curl is a C library for HTTP access. On certain systems such as Linux, they are usually in the package repository right out of the box, so don't reinvent the wheel by doing HTTP with raw TCP yourself.

http://curl.haxx.se/libcurl/
# 4  
Old 04-16-2007
The chapter "IPC:Sockets" is exlpained socket programming.
http://www.cs.cf.ac.uk/Dave/C/
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

New to AIX tcpip tuning

For some reason, my AIX 5.2 box has become slow in accepting telnet requests from others boxes. Windows, times out the connection, whereas, Unix it will wait for the AIX to display the login. I connect and it respawns back and says connected, but then sits and wait for what seems forever to get the... (5 Replies)
Discussion started by: mrmurdock
5 Replies

2. Solaris

Please help with opening a port??

Hello all, I need assistance... I need to open a port # 36677 and have it remain open even after a power cycle. I thought all I needed to do was add it to /etc/services. That was not it... Can someone please tell me how to do this. Thank you. (6 Replies)
Discussion started by: komputersman
6 Replies

3. AIX

AIX routing and TCPIP. Anyone find any good Tutorials?

HI All, Does anyone out there know of any good online tutorials for the basics of routing, gateways, networking with AIX, preferably the more recent versions like 5.2/5.3? Using commands such as netstat, smit mkroute, etc. to connect to boxes on a network, and load software with networked... (1 Reply)
Discussion started by: jeffpas
1 Replies

4. UNIX for Dummies Questions & Answers

Opening a port on HPUX 11

7 I need to connect to a Unidata database using rpc on a HPUX 11 unix machine. The rpc software on Unidata uses port 31438 which does not appear to be available. How can I check the status of this port and activate it for tcp use? (0 Replies)
Discussion started by: SkyBlue
0 Replies

5. AIX

Problem opening port 9998

Hi there, I have been trying to open port 9998 on an AIX 5.1 box to no avail. This machine is not connected to the internet and I have only been accessing it locally, so I know it's not a network firewall/proxy issue. I have tried editing /etc/services and inetd.conf, refreshing inetd.conf, and... (3 Replies)
Discussion started by: erica057
3 Replies

6. UNIX for Advanced & Expert Users

TCPIP Printer in Unix

How do we install a Printer connected directly to network with a private IP of 192.9.168.109 on a SUN system with IP of 192.9.168.2 so that we can use it with the lp command. The printer is a standard Line Matrix Printer. I would like to know how to add it from COMMANDLINE also. Thanx (3 Replies)
Discussion started by: /etc/passwd
3 Replies

7. UNIX for Dummies Questions & Answers

opening ssh port

I've got openssh installed but when i try to ssh to my machine i get a "port 22: connection refused" message. Do I need to add something to the hosts.allow file to allow ssh access in? I'm running Mandrake 8.1 (5 Replies)
Discussion started by: gasaraki99
5 Replies

8. UNIX for Dummies Questions & Answers

opening port

i need to open port 1470. how do i do this. whats the command. This is on a solaris box. Thanks (1 Reply)
Discussion started by: ollyparkhouse
1 Replies

9. UNIX for Dummies Questions & Answers

OPening A Port

My mail went down and the company told me to open port 110 on my server. How do I do this? (2 Replies)
Discussion started by: djatwork
2 Replies
Login or Register to Ask a Question