Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

help: How to bind a TCP/IP socket ?

nhwind
Beginner
931 Views
I'm trying to use write a TPC/IP socket program. But i'm not to know how bind a socket . Here is the code:
program WINSOCK
use dfwin
implicit none

integer Err,Pcol,IP,Queue
integer*2 wVer,port

type(T_s_sockaddr_in) IpAddr
type (T_WSADATA) WSinfo

wVer=#101
Err = WSAStartup (wVer,WSinfo)
Pcol= socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)

port=1250
IpAddr.sin_family=AF_INET
IpAddr.sin_port=htons(port)
IpAddr.sin_Addr.s_addr=htonl(INADDR_ANY)

Err= bind(Pcol,IpAddr,sizeof(IpAddr))

Err= WSAGetLastError()
print *,'Done'
end program WINSOCK

Some one can help me correct this binding socket,please ?
Sorry for possible grammar and other mistakes.
0 Kudos
2 Replies
Paul_Curtis
Valued Contributor I
931 Views
This may help. Code has been extracted from a larger program, and will need to be slightly modified to be stand-alone.
0 Kudos
onkelhotte
New Contributor II
931 Views

Hi there,
is there a way to establish a TCP IP connection between a fortran program with another program?

Markus

0 Kudos
Reply