- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This may help. Code has been extracted from a larger program, and will need to be slightly modified to be stand-alone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
is there a way to establish a TCP IP connection between a fortran program with another program?
Markus

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page